Click here to Skip to main content
11,581,515 members (63,429 online)
Rate this: bad
Please Sign up or sign in to vote.
How do I set up a program to when a user enters something into a text box,click a button, then it shows up in a list box?

Improved Question:
Alright,that's been solved. That was only a small part of this,as when someone clicks an item in the list box(right now theres only one there,"example1",when they click it,it shows on the right the account name"example1",the User Name "potato" and password,"pickle". The example one was already set by me,but if someone adds a new item to the list box,how would I set it up to where they can also add a log in and password,to where if they click one that they added,that it will also show a username and password next to it?
Posted 7-Oct-12 7:23am
Edited 7-Oct-12 8:18am
Sandeep Mewara at 7-Oct-12 13:24pm
Insert the texted item into the list box in button click event?
Devin Halbert at 7-Oct-12 13:26pm
Wait so would this work?(lbx=List Box,tbx=Text Box)
lbxAccounts.SelectedItem = tbxNewAccountName.Text
Sandeep Mewara at 7-Oct-12 13:30pm
No it would not. You need to create a new item and then set the item as text data and then add the item to listbox.
Wes Aday at 7-Oct-12 13:30pm
Devin Halbert at 7-Oct-12 13:32pm
You must be a pc god,you have answered 3 of my 3 questions I have asked :D
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Follow the following coding:


Add the above code in your button's click event.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try this code:
Private Sub button1_Click(sender As Object, e As EventArgs)
End Sub

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

  Print Answers RSS
0 OriginalGriff 340
1 Sergey Alexandrovich Kryukov 160
2 virusstorm 114
3 Frankie-C 105
4 RyanDev 84
0 OriginalGriff 1,273
1 Sergey Alexandrovich Kryukov 895
2 Abhinav S 597
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 7 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100