How to include list box control in visual basic project, Visual Basic Programming

How to Include List Box control in your project

A list box is used for representing the users with a data. You can prefer the data from the list box for data entry. No editing is possible in the list box. If you want to edit you must use a combo box control.

Illustration: A Project to describe the Use of List Box

1) Establish a new Project by choosing a File and then the New Project.

2) Suppose the project type be Standard EXE.

3) Add a list box and a text box to the form.

4) Double click on the form. And add the coding given below:

Private Sub Form_Load()

List1.AddItem "a"

List1.AddItem "b"

List1.AddItem "c"

List1.AddItem "d"

End Sub

This will generate a list box as shown in the figure with the contents a, b, c & d.

5) Relate the click event with the list box

Private Sub List1_Click()

Text1.Text = List1.Text

End Sub

Whenever an item is clicked in the list box, the contents will be transferred to the Text Box.

2321_combo box.png

Figure: A Form with Combo Box Control

Posted Date: 10/9/2012 8:06:51 AM | Location : United States







Related Discussions:- How to include list box control in visual basic project, Assignment Help, Ask Question on How to include list box control in visual basic project, Get Answer, Expert's Help, How to include list box control in visual basic project Discussions

Write discussion on How to include list box control in visual basic project
Your posts are moderated
Related Questions
Problem 1. Describe the concept of exception in .Net environment 2. Explain the process of adding, updating and deleting records with an example 3. Explain DTD elements a

DATA TYPES   The different primitive data types are Boolean, Char, Byte, Date, Decimal, Uinteger, Double, Integer, Long, Sbyte, Short, Single, String, Ulong & Ushort. To decla

I have an external application I open from visual studio (excel). I want to reposition where that opens (top, left).. How do I do that?

Difference between Class Module and Standard Module? Standard module: -This place for variable declarations,procedures etc.& it can accessed these procedures in whereve

FILES IN A VB PROJECT The project file has the.vbp extension. The form in which we draw has the .frm extension; .mod denotes the module file; .cls denotes the class file; .res

PROJECT TO CREATE SPLITTER WINDOW   1. Generate the SDI application. 2. Enlarge the class tab page. 3. Select the view class. 4. On right clicking the menu pops up.

Use the While keyword to verify a condition in a Do...Loop statement. You can verify the condition before you enter the loop (as illustrated in the following ChkFirstWhile instance

The Refresh Method: The refresh method transfer to the first record in the record set. To invoke the refresh method follow the syntax which is as shown below: Form1.Data1.R

Aim: To exhibit what is the day when the second command button is clicked and to clear the screen when the first command button is clicked. The functioning of this program is

Software That Is Rude: The software warns the user for making the mistakes. The Message boxes pop up representing the mistake and the user will have to click the OK or CANCEL