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
Restricting The Vocabulary: The properly formed vocabulary is like an inverted pyramid. All easy to learn communication system follow this pattern. The canonical vocabulary in

CONTROL STATEMENTS   The conditional expression uses a comparison operator that results in true or false value. If the comparison is valid the outcome is true, or else the out

This is a member of Microsoft's Visual Basic family of development products. Other members comprise Visual Basic (Professional and Standard Editions) & Visual Basic for Application

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

INTRODUCTION TO VB: The Windows programming is an event driven programming. The VB uses the Hungarian Notation for naming the variables. It deals with new data types like HWND,

Using Visual Studio 2010 C++ 1) Using Windows Explorer, make a copy of Irvine\examples\Project_sample folder in the folder where you keep your materials for this course.

To run only one statement while a condition is True, employ the single-line syntax for the If...Then...Else statement. The following instance shows the single-line syntax. Notice t

Databound Controls - A controls use to display the contents of table using Data Control , have to bound each Control to the specific field and the controls are Known as the Data Bo

THE MFC CLASSES The CDocument, CWinAppCFrameWnd and CView are derived from the CObject and they give the majority of the structure and functionality.

Use of WM_SIZE Message: Whenever the WM_SIZE message is handled and the graphical objects on the output window will also change consequently to the output window. The functi