listbox datatable selected item

  • Thread starter Thread starter cptkirkh
  • Start date Start date
C

cptkirkh

I havea listbox bound to a datatable. When the form loads it thinks
the first item is selected. Is there anyway to tell the listbox when
it loads not to select the first time automatically?
 
In the form's Load event handler:

Fill the DataTable

Set the SelectedIndex property of the ListBox to -1

Add the desired event handlers to the corresponding events of the ListBox

In this case Do NOT 'wire' up the event handlers for the ListBox at design
time.
 
Back
Top