The process of creating a list box is the same as for a combo box. The only difference is that you can select more than one item using a list box. By default, though, you can select only one item. In order to select multiple items you have to set the SelectionMode property of the list box to MultiSimple or MultiExtended.
The MultiSimple property enables you to select all items with mouse clicks. It toggles the selected item. On the other hand, the MultiExtended property enables you to select items by holding either the Shift or Control key. The code for producing a list box using the MultiSimple property is shown in listing 7.7
In the next article, you will learn how to handle events using the above explained controls.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |