Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...