In this video I show you how to create a calculator in visual basic 6.
Instruction
Difficulty level: Difficult
step 1
step 1 is simple. We just have to drag and drop on the form of buttons, drawing, etc..
2 step
step 2. Enter the code for each button. To open the code window, click on the button for which you want to enter the code 2 times.
+ - Text3.Text = Val(Text1.Text) + Val(Text2.Text) Russian - text3 = text1 + text2
Button - Text3.Text = Val(Text1.Text) Val(Text2.Text) only Changes the sign !
Button * - Text3.Text = Val(Text1.Text) * Val(Text2.Text)only Changes the sign !
Button / - Text3.Text = Val(Text1.Text) / Val(Text2.Text)only Changes the sign !
Button root - Text3.Text = Val(Text1.Text) * Val(Text1.Text) And there ) Root text3 = text1 * text1
3 step
The clear button and exit
Let's write the code for the exit button (very easy)
code End In the Russian end, the output of the well and the like. You can do so by pressing the exit button popped up a message like this still Go on my website or booby well, etc. To do this, write the code :
MsgBox ( Trial version calculator ! ! ! ) Here in my case.
The clear button. Well, here is all ponjatnoi likewise the buttons +,-
Text1.Text = ""
Text2.Text = ""
Text3.Text = 0
That's all.. We wrote a program in basic. Pozravlau !!!
step 4
Easy to write and very difficult to understand what you wrote ) Calculator another program easy but some players good Luck
No comments:
Post a Comment