Making Piggy Bank | visual basic 6.0 - wordsclank.in

Saturday 8 April 2017

Making Piggy Bank | visual basic 6.0

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

piggy bank,Visual Basic

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 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..




           







2 comments:

  1. Nice work but more information should be there

    ReplyDelete
    Replies
    1. Thanks for the comment Atul Anand.We will try to be more widely from the next time.

      Delete