Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I set the SelectedItem property in a databound ComboBox?

Use the FindStringExact method. For example, to set the ComboBox's ValueMember property to "OrderID", then you could call

comboBox1.SelectedIndex = comboBox1.FindStringExact( stringOrderID );

where stringOrderID is the orderID of the row to be selected.

Contributed from George Shepherd's Windows Forms FAQ



Page view counter