|
-
October 15th, 2001, 12:29 PM
#3
Re: Need help with Code for a Calculator?
Something like this maybe?
private Sub Command1_Click()
Select Case true
Case optAdd
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Case optSub
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
Case optMul
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
Case optDiv
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Select
End Sub
Note to merrion: I used your if-then-elseif-to-select-case method you posted on http://www.vbcodelibrary.co.uk/board, and I like it!
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|