08-The Listbox

0
366

This Visual Basic tutorial is all about the Listbox.
ListBox control displays a list of items that enables the user to select one or more and present a list of choices.

 

The choices are displayed vertically in a single column by default, although you can set up multiple columns too. The user can scroll up and down, or left to right through the list using  scroll bars  when the number of items exceeds.

 

Example:

lbox1

This is the syntax in adding items to a list box. Use the Items.Add() method. See the example below.

  1. ListBox1.Items.Add("janno")

This is the syntax in removing specific item in a listbox. Use the Items.Remove() method. See the example below.

  1. ListBox1.Items.Remove("janno")

This is the syntax in removing all items in a listbox. Use the Items.Clear() method. See the example below.

ListBox1.Items.Clear()

[/vb]

 

 

Readers might read also:

 

Facebook Comments
(Visited 25 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here