Click here to Skip to main content
13,005,192 members (61,011 online)
Rate this:
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
Updated 7-Oct-12 8:18am
Sandeep Mewara 7-Oct-12 13:24pm
Insert the texted item into the list box in button click event?
Devin Halbert 7-Oct-12 13:26pm
Wait so would this work?(lbx=List Box,tbx=Text Box)
lbxAccounts.SelectedItem = tbxNewAccountName.Text
Sandeep Mewara 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 7-Oct-12 13:30pm
Devin Halbert 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 7 Oct 2012
Copyright © CodeProject, 1999-2017
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