0% found this document useful (0 votes)
132 views1 page

WinForms ListBox Control Guide

The ListBox control in WinForms C# allows users to display and select one or more items from a list. The document outlines steps for setting up a ListBox, adding items through design time or dynamically, changing the selection mode, counting items, sorting items, clearing items, and removing a specific item.

Uploaded by

Malik Akmal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views1 page

WinForms ListBox Control Guide

The ListBox control in WinForms C# allows users to display and select one or more items from a list. The document outlines steps for setting up a ListBox, adding items through design time or dynamically, changing the selection mode, counting items, sorting items, clearing items, and removing a specific item.

Uploaded by

Malik Akmal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

LISTBOX CONTROL IN WINFORMS C#

ListBox control provides a user interface to display a list of items. Users


can select one or more items from the list.
STEPS:
 SETTING UP THE FORM
 ADDING THE LISTBOX.
 CHANGING THA NAME PROPERTY OF LISTBOX CONTROL.
 ADDING THE ITEMS IN LISTBOX THROUGH DESIGN TIME USING ITEMS PROPERTY.
 CHANGING THE SELECTION MODE FROM SELECTION MODE PROPERTY
 NOW WE HAVE TO ADD ITEMS IN LISTBOX DYNAMICALLY SO WE NEED ONE LABEL, ONE
TEXTBOX AND ONE BUTTON.
 AFTER ADDING ITEMS DYNAMICALLY THEN WE HAVE TO CLEAR THE TEXTBOX AND
FOCUS AGAIN INTO THE TEXTBOX.
 THEN WE HAVE TO COUNT THE ITEMS OF LISTBOX AND DISPLAY USING A BUTTON.
 NOW WE HAVE TO SORT THE LIST ITEMS ASCENDING ORDER USING BUTTON.
 THEN WE HAVE TO CLEAR ALL THE LIST ITEMS IN LIST BOX USING A BUTTON.
 THEN WE HAVE TO REMOVE A SPECIFIC IT EM FROM THE LIST BOX.
o REMOVE METHOD
o REMOVEAT METHOD

You might also like