Hi..
Its very fun to work in visual basic 6.0. Now what are going to do a simple program i.e a Piggy Bank using visual basic.
so let start from the design
Here is the design we have made. You can make the design in your way also.
we have taken 6 label , 4 text box , 1 command button
four labels for 1 rupees , 2 rupees ,5 rupees and 10 rupees
one for displaying TOTAL and one for caption TOTAL
4 text box for taking the inputs from user
Now proceed to the code part
we are writing the code under the click event of command button
Dim n, m, o, p, q as integer
n = val(text1.text)
m = val(text2.text)
o = val(text3.text)
p = val(text4.text)
q = n + m + o + p
Label6.Caption = q
End Sub
NOTE
1. Dim is used to declared a variable. Here we have declared m,n,o,p,q as integer data type.
2.Val function is used to change a string to numeric
3. Label6 is name of the label on which we are displaying the result.
4.We have change the property through property bar if it is creating problem then comment on this post and we will try to give you the code for changing the caption,text and etc.
Thanks for reading the post. Hope it will help you. If have any doubt comment in comment section we will vary much happy to help you..
Here is the design we have made. You can make the design in your way also.
we have taken 6 label , 4 text box , 1 command button
four labels for 1 rupees , 2 rupees ,5 rupees and 10 rupees
one for displaying TOTAL and one for caption TOTAL
4 text box for taking the inputs from user
Now proceed to the code part
we are writing the code under the click event of command button
Private Sub Command1_Click()
Dim n, m, o, p, q as integer
n = val(text1.text)
m = val(text2.text)
o = val(text3.text)
p = val(text4.text)
q = n + m + o + p
Label6.Caption = q
End Sub
NOTE
1. Dim is used to declared a variable. Here we have declared m,n,o,p,q as integer data type.
2.Val function is used to change a string to numeric
3. Label6 is name of the label on which we are displaying the result.
4.We have change the property through property bar if it is creating problem then comment on this post and we will try to give you the code for changing the caption,text and etc.
Thanks for reading the post. Hope it will help you. If have any doubt comment in comment section we will vary much happy to help you..
Nice work but more information should be there
ReplyDeleteThanks for the comment Atul Anand.We will try to be more widely from the next time.
Delete