event ClickButton (Button as String, ByRef 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 (By Reference) 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 VB6 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

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

Private Sub Excalc1_ClickButton(ByVal sender As System.Object, ByVal Button As System.String, ByRef Cancel As System.Boolean) Handles Excalc1.ClickButton
    If (Button = "sin") Then
        With Excalc1
            .Execute(Math.Sin(.Caption))
        End With
    End If
    If (Button = "cos") Then
        With Excalc1
            .Execute(Math.Cos(.Caption))
        End With
    End If
End Sub

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

private void excalc1_ClickButton(object sender, string Button, ref bool Cancel)
{
    if (Button == "sin") 
        excalc1.Execute(Math.Sin(Convert.ToDouble(excalc1.Caption)).ToString());
    else if (Button == "cos")
        excalc1.Execute(Math.Cos(Convert.ToDouble(excalc1.Caption)).ToString());
}