oasis1000 Posted October 13, 2003 Posted October 13, 2003 Hello everyone, I'm new to this forum. First of all, I am trying to create a program using vb6. I want to create a program that uses loops. How do I do this... The user will input information into a textbox called "txtInput", there is the command button, "cmdEnter", which will output this information into labels..lbl1, lbl2, lbl3, lbl4 and lbl5. It should look like this.. Input Info [Enter Info] out put here: lbl1 lbl2 lbl3 lbl4 lbl5 Can anyone help? should I be using a for-loop? I can't seem to figure it out, i am new to programming, i'm taking a intro prog class in university. Quote
*Experts* Nerseus Posted October 13, 2003 *Experts* Posted October 13, 2003 What exactly are you putting the labels? If you have a fixed number of labels and you expect the text in txtInput to be in a certain format, then I wouldn't use a loop. Normally you would only use a loop to fill controls if the data is unknown and expected to be dynamic (such as if you were reading in an unknown number of fields from a file). If your textbox is to take, say, a first and last name and you want to fill two lables, then don't use a loop to fill each box - hard-code the filling of each label based on however you split the name typed in. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
oasis1000 Posted October 13, 2003 Author Posted October 13, 2003 Hello, Im just putting a list of names.. Its a fixed number, but I want to just have one text input box. I have a list of names, lets say its bob, joe,mark,james,troy. The user would put one name at a time into the textbox, press enter and the name will appear on a label below, then the person will enter a another name, press enter and the name will appear under the first name..and etc.. wouldn't i use a for loop...1 to 5 thanks for any help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.