Docsity

List-Based Controls: ComboBox, ListBox, and CheckedListBox, Slides of C Sharp Programming

Partial preview of the text

Download List-Based Controls: ComboBox, ListBox, and CheckedListBox and more Slides C Sharp Programming in PDF only on Docsity!

List-based Controls

Introduction

 There are several controls that work with lists  ComboBox  ListBox  CheckedListBox

The ComboBox Control (2)

 The DropDownStyle property controls how the list drops-down, and whether the box is editable  Count contains the number of items in the list  Adding and removing items works the same way as any collection  Add , Insert , Clear , Remove

The ComboBox Control

Adding items at design-time

 Set the Items property using the String Collection Editor

The ListBox Control (1)

 It’s really a ComboBox that does not drop- down  Most of the properties work the same way  Set the SelectionMode property to select one or many items  One , MultiSimple , MultiExtended  Call GetSelected and SetSelected to determine whether an item is selected or to select an item

The CheckedListBox

Control

 It’s really just a ListBox control