Attached File(s)
-
code.txt (1.96K)
Number of downloads: 1265




Posted 22 February 2011 - 07:57 AM
code.txt (1.96K)
Posted 22 February 2011 - 07:59 AM
Posted 22 February 2011 - 08:00 AM
WWW.COE_89, on 22 February 2011 - 07:57 AM, said:
1 'Declare the global variables to be used throughout the form 2 Dim mfirst As Single 3 Dim msecond As Single 4 Dim manswer As Single 01 Private Sub cmd0_Click() 02 'Put the value 0 into the text box 03 Text1.text = Text1.text + "0" 04 End Sub 05 06 Private Sub cmd1_Click() 07 'Put the value 1 into the text box 08 Text1.text = Text1.text + "1" 09 End Sub 10 11 Private Sub cmd2_Click() 12 'Put the value 2 into the text box 13 Text1.text = Text1.text + "2" 14 End Sub 15 16 Private Sub cmd3_Click() 17 'Put the value 3 into the text box 18 Text1.text = Text1.text + "3" 19 End Sub 20 21 Private Sub cmd4_Click() 22 'Put the value 4 into the text box 23 Text1.text = Text1.text + "4" 24 End Sub 25 26 Private Sub cmd5_Click() 27 'Put the value 5 into the text box 28 Text1.text = Text1.text + "5" 29 End Sub 30 31 Private Sub cmd6_Click() 32 'Put the value 6 into the text box 33 Text1.text = Text1.text + "6" 34 End Sub 35 36 Private Sub cmd7_Click() 37 'Put the value 7 into the text box 38 Text1.text = Text1.text + "7" 39 End Sub 40 41 Private Sub cmd8_Click() 42 'Put the value 8 into the text box 43 Text1.text = Text1.text + "8" 44 End Sub 45 46 Private Sub cmd9_Click() 47 'Put the value 9 into the text box 48 Text1.text = Text1.text + "9" 49 End Sub 1 Private Sub cmdADD_Click() Text1.text=text.text + “+” End sub Subtract: 1 Private Sub cmdSUBTRACT_Click() Text1.text=text.text + “-” End sub Multiply: 1 Private Sub cmdMULTIPLY_Click() Text1.text=text.text + “x” End sub Divide: 1 Private Sub cmdDIVIDE_Click() Text1.text=text.text + “/” Equals: 01 Private Sub cmdEQUALS_Click() 02 msecond = Val(txtNUMBER) 03 04 Select Case mbutton 05 Case Is = 1 06 manswer = mfirst + msecond 07 Case Is = 2 08 manswer = mfirst - msecond 09 Case Is = 3 10 manswer = mfirst * msecond 11 Case Is = 4 12 manswer = mfirst / msecond 13 End Select 14 txtNUMBER = manswer 15 End Sub
This post has been edited by macosxnerd101: 22 February 2011 - 08:01 AM
Reason for edit:: Fixed code tags. PLEASE, [code] Your Code Goes Here [/code]
Posted 22 February 2011 - 08:06 AM
Posted 22 February 2011 - 08:12 AM
Posted 22 February 2011 - 01:59 PM
Quote
01 Private Sub cmd0_Click() 02 'Put the value 0 into the text box 03 Text1.text = Text1.text + "0" 04 End Sub 05 06 Private Sub cmd1_Click() 07 'Put the value 1 into the text box 08 Text1.text = Text1.text + "1" 09 End Sub 10 11 Private Sub cmd2_Click() 12 'Put the value 2 into the text box 13 Text1.text = Text1.text + "2" 14 End Sub 15 16 Private Sub cmd3_Click() 17 'Put the value 3 into the text box 18 Text1.text = Text1.text + "3" 19 End Sub 20 21 Private Sub cmd4_Click() 22 'Put the value 4 into the text box 23 Text1.text = Text1.text + "4" 24 End Sub 25 26 Private Sub cmd5_Click() 27 'Put the value 5 into the text box 28 Text1.text = Text1.text + "5" 29 End Sub 30 31 Private Sub cmd6_Click() 32 'Put the value 6 into the text box 33 Text1.text = Text1.text + "6" 34 End Sub 35 36 Private Sub cmd7_Click() 37 'Put the value 7 into the text box 38 Text1.text = Text1.text + "7" 39 End Sub 40 41 Private Sub cmd8_Click() 42 'Put the value 8 into the text box 43 Text1.text = Text1.text + "8" 44 End Sub 45 46 Private Sub cmd9_Click() 47 'Put the value 9 into the text box 48 Text1.text = Text1.text + "9" 49 End Sub
Private Sub cmdNumPad_Click(Index as Integer) Text1.Text = Text1.Text & cStr(Index) End SubJust that simple.
This post has been edited by BobRodes: 22 February 2011 - 02:10 PM
