Programming MathCalculator

johnsraid

Newcomer
Joined
May 31, 2003
Messages
3
Hello
May you help me to finish programming the MathCalculator App:

Private Sub Digit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttn1.Click, bttn2.Click, bttn3.Click, bttn4.Click, bttn5.Click, bttn6.Click, bttn7.Click, bttn8.Click, bttn9.Click, bttnZero.Click

Thanks
 
What code to add to obtain corresponding digit displayed when I press a digit button? So how to append the digit clicked to the calculator's display?
Thks
 
Lets say your calulator display is a textbox, and that the buttons will contain only the number you want to use when they are clicked.
Visual Basic:
Private Sub Digit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttn1.Click, bttn2.Click, bttn3.Click, bttn4.Click, bttn5.Click, bttn6.Click, bttn7.Click, bttn8.Click, bttn9.Click, bttnZero.Click

if sender is bttn1 then
       textbox1.appendText(bttn1.text)
elseif sender is bttn2 then
       textbox1.appendText(bttn2.text)
elseif
       'repeat this for every button
end if
 
Back
Top