Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do you "Link" a button and a text box? Right now, I'm testing around with a password storing program where the user must first type a user name and password,both separate text boxes,then a panel becomes visible,with a label that says "Choose an account",followed by a list box that will have multiple different accounts,then a button below that to select them,to where when the person clicks an option,they must click the select button. Next to those(also on the panel) are 3 labels and 3 read only text boxes, the labels say "Account Name","Login",and "Password",there is 1 text box below each of those. When the user clicks the account under the list box and clicks "select",I want the correct account name(same as in the list box),that account's login,and that account's password. So basically have 2 questions,linking the username and password in the beginning to where it must be the correct login or else a message box will come up saying something like "Login Incorrect",but if they have the correct logins,the panel will become visible and show up next to the page. The next question is about the list box and linking the button,and linking the button to the 3 read only text boxes. How do I do this? So far,I added an example,there is 1 item under the list box,which is "banana1". The accountname is Banana2(so I don't get confused while I work on it,I will change it once I am done with the program),the user name is "pickle",and the password is "potato123". Help,please?
Posted
Comments
[no name] 6-Oct-12 21:48pm    
Very confusing. You would "link" your textboxes and the buttons the same way that you did for your quiz...
Devin Halbert 6-Oct-12 21:51pm    
Yes,but that was with radio buttons,I do not know how to have it set up to when the user clicks an account name,then clicks "select",that the correct items show up. With the quiz,I could use radio buttons and in code type that when rdbA1 was clicked,then display whatever. Here,I don't know how to do so with a list box.
[no name] 6-Oct-12 21:58pm    
Did you bother looking up the listbox in the documentation and seeing if there was something there that would tell you what was selected? The SelectedIndex maybe? SelectedItem? SelectedValue?
Devin Halbert 6-Oct-12 22:04pm    
Wait,found it! Thx alot lol....Yea I'm pretty much a blonde at programming ;)
Devin Halbert 7-Oct-12 13:00pm    
Hey another question though,How would I set it up to where a user can create a new account in the list box and also add their username and password,AND to where when they click that account name and click select,that it will show the account name,username,and password?

1 solution

With help of Wes comments, OP was able to resolve it. Posting this to pop it out of unanswered list.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900