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