Windows Forms: ListBox and ComboBox

Demonstrates binding ListBox and ComboBox controls, and working with selected items.

Highlights

Demonstrates several different techniques for binding data to ListBox and ComboBox controls, and shows different ways to retrieve the selected item or items from the controls.

Requirements

This application requires the release version of Visual Studio .NET Professional (or greater) and access to the Northwind database residing in SQL Server or the Microsoft Data Engine (MSDE). To install MSDE, do the following:

1. Open the Start menu, click Programs, click Microsoft .NET Framework SDK, and then click Samples and Quickstart Tutorials.

2. Click "Step 1: Install the .NET Framework Samples Database".

3. Open a command window, and CD to \Samples\Setup This is typically : C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Samples\Setup

4. Type: osql -E -S (local)\NetSDK -i InstNwnd.sql

Running the Sample

The pages of the Tab control on the sample demonstrate different techniques: