List Control in Visual Basic6.0


The List control is used to present a list of items where thr user can click and select the items from the list.In order to add items to the list,we can use the AddItem method.

1.Start Visual Basic and pick “Standard Exe” from the list of new projects.

2. Go to the properties page (on the right) and find the caption property for the main form (Form1).

3. Add a List control to the form by clicking the List tool and then drawing on the form.

 

 

 

 

 

 

4. Double click the ListBox . This will bring up the code-view Now, double window. Type in the following code into the List1_Click() subroutine shell that’s generated for you:

 

 

 

 

 

 

 

 

 

5. At this point, press <F5> key to  run the program and select the option to see what happens.

 

 

 

 

 

 

6. When you select red option from Listbox then form’s colour is change and show a message

Comments are closed.