SpeakComputers.com
Home
Software
Electronics
Desktop Computers
Laptops
Games
Handheld Devices
Mobile Phones
Cameras
Camcorders
Printers
Books
Software Downloads 2012 Software Mac Software Security Student Editions Windows 7 Office 2010
ASP.NET C# VB.NET C++ .NET Infragistics DevComponents

VB.NET ListBox Control.

The VB.NET System.Windows.Forms.ListBox control enables you to display a list of items from which the user can select one or multiple items from the list. The default is for the ListBox to list the items vertically however setting the multicolumn property to true the items are listed horizontally. The control is typically used to display data from a database. The items listed within the ListBox cannot be edited directly.

Namespace: System::Windows::Forms
System.Windows.Forms (in system.windows.forms.dll)

Creating an new VB.NET Windows forms ListBox.
Dim listbox As New ListBox

Assigning a new location for the VB.NET Windows Forms ListBox.
listbox.Location = New Point(0, 0)

Assigning a Selection Mode value to the VB.NET ListBox control.
listbox.SelectionMode = SelectionMode.MultiExtended

Adding a VB.NET ListBox control to the form.
Me.Controls.Add(listbox)

Adding items to the VB.NET ListBox control.
Dim s1 As String = "DELL"
Dim s2 As String = "HP"
Dim s3 As String = "SONY"
listbox.Items.AddRange(New String() {s1, s2, s3})

Creating a Selected Index Changed Event for the VB.NET ListBox control.
AddHandler listbox.SelectedIndexChanged, AddressOf listbox_selectedIndexChanged

Responding to the VB.NET ListBox Selected Index Changed event.
Private Sub listbox_selectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show(listbox.SelectedItem.ToString())
End Sub

VB.NET ListBox control Tutorial.
Computer Security
AntiVirus Software
Internet Security
Parental Controls
Backup & Recovery
Computer Protection
Anti Malware
Photo & Video
Photo & Video Editing
Video Music
Desktop Publishing
Professional Design
Home Publishing
Clipart
Business & Accounting
Accounting
Payroll
Check Printing
TAX
H&R Block
Microsoft Office
Design
Graphic Design
Home Design
Garden Design
Interior Design
Computer Aided Design
3D Design
Students & Teacher
Adobe
Microsoft Office
Dragon Naturally Speaking
Corel Draw
Serif
Student/Teacher Software
Copy Right 2006 SpeakComputers.com - All Rights Reserved.
Home About Privacy Policy Resouces