Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   VB 6 Small Program Check Me (http://www.go4expert.com/forums/vb-6-small-program-check-t22896/)

skaterboi1234 1Aug2010 13:14

VB 6 Small Program Check Me
2 Attachment(s)
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... :)

shabbir 1Aug2010 14:11

Re: VB 6 Small Program Check Me
Any reason to post it thrice?

virxen 2Aug2010 03:03

Re: VB 6 Small Program Check Me
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.

skaterboi1234 2Aug2010 07:35

Re: VB 6 Small Program Check Me
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.

skaterboi1234 2Aug2010 12:42

Re: VB 6 Small Program Check Me
Sir can u show it where do i put the codes? thanks

virxen 3Aug2010 03:46

7 Attachment(s)
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)

skaterboi1234 3Aug2010 13:28

Re: VB 6 Small Program Check Me
Thanks Sir that was clear and fantastic thanks so much......

All times are GMT +5.5. The time now is 18:42.