event ClickButton (Button as String, Cancel as Variant)
Occurs when the user clicks the control's button.

 TypeDescription 
   Button as String A string expression that indicates the name of the being clicked. The Button parameter does not include the HTML format.  
   Cancel as Variant A boolean expression that indicates whether the default operation is executed or canceled.  
Use the ClickButton event notifies your application that the user clicks or presses a button. Use the ClickButton event to handle custom operations in the control. Use the Buttons property to append new buttons to the control. Use the Execute method to execute operations.

The following sample adds a new button 'sin' and execute the trigonometric sin function when 'sin' button is clicked:

Private Sub Form_Load()
    With CalcCombo1
        .Buttons = .Buttons + vbCrLf + "<b>sin<b>"
    End With
End Sub
Private Sub CalcCombo1_ClickButton(ByVal Button As String, Cancel As Variant)
    If (Button = "sin") Then
        With CalcCombo1
            .Execute Sin(.Caption)
        End With
    End If
End Sub


Send comments on this topic.
© 1999-2006 Exontrol Inc, Software. All rights reserved.