1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

VB 6 Small Program Check Me

Discussion in 'Visual Basic ( VB )' started by skaterboi1234, Aug 1, 2010.

  1. skaterboi1234

    skaterboi1234 New Member

    Joined:
    Aug 1, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hi I want to develop program in Visual Basic 6, is a small program that lets you input any number from 1 to 5 and automatically display the corresponding number to its row. I have some screenshots i finish the design, my problem is the coding part. please help..here's my print screen screenshots. see the attachments thanks... :)
     

    Attached Files:

  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    Any reason to post it thrice?
     
  3. virxen

    virxen New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
    first of all,you don't say which is the trigger you want to use.
    1)as user types? text1_change()
    2)after user press enter? text1_keypress()...if keyascii=13....


    to do what you want you must create a control array of textboxes.
    how you do that?
    you have already 5 textboxes from 1 to 5 right?
    lets assume that the first one is called text2 and the next text3 and so on.
    you go to the properties of text3 and you change (name) property to text2
    then vb asks you "you have already a textbox called text2 do you want to create a control array?" you choose yes.
    you do the same for all remaining textboxes.

    now the names are text2(0)->1 ,text2(1)->2,text2(2)->3......

    and the last thing is
    1)clear all textboxes when the trigger is executed(user pressed enter for example)
    2)check the value if is within the limits you set 1-5
    3)place the number entered into text2(x-1).text=cstr(x) where x the number between 1-5.

    try this and if you cannot do it tell me to help you again.
     
    Last edited: Aug 1, 2010
  4. skaterboi1234

    skaterboi1234 New Member

    Joined:
    Aug 1, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Sir thanks for the tips there, the 5 boxes is not a textbox is a label sir,which i want to use as a display output only, it can't be edited or type it.
     
  5. skaterboi1234

    skaterboi1234 New Member

    Joined:
    Aug 1, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Sir can u show it where do i put the codes? thanks
     
  6. virxen

    virxen New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
    1) we create the form (foto 1)

    2) we leave the first label (label7) as it is and click on label8
    we go to its properties and we change its name to label7 (as the first one we left as it was)(fotos 2-3)

    3)in the following question we press yes (foto 4)

    4)we change the remain labels as we did in step 2(foto 5)
    you see the name? label7(4) !!!

    5) we go to properties and change all captions to null,nothing (foto 6)

    6) and finally the coding....(foto 7)
     

    Attached Files:

    Last edited: Aug 2, 2010
  7. skaterboi1234

    skaterboi1234 New Member

    Joined:
    Aug 1, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Thanks Sir that was clear and fantastic thanks so much......
     

Share This Page