How to Simulate a Particular Button in the Calculator

3 Sep 20201 minute to read

We can use Calculator.ButtonAction method for this. When the user clicks the button, the ButtonAction method of the Calculator control will call back the action of the particular button (in this example it is “=” button) and displays the result in the textbox area, using CalcActions Enumerator. This enumerator has all the actions that can be assigned to the calculator buttons including digits and arithmetic operators also.

private void buttonAdv1_Click(object sender, EventArgs e)

//Performing the "=" button action
Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As System.EventArgs) 

'Performing the "=" button action
End Sub