ListBox SelectionMode None ??

  • Thread starter Thread starter Q. John Chen
  • Start date Start date
Q

Q. John Chen

I have a ListBox only to display list of data and do not want user to
select anything.

I set the SelectionMode to None. It worked as expected.

But, when I close the window. The generated Dispose method raises an
ArgumentException:

Cannot call this method when SelectionMode is SelectionMode.NONE.\r
\nParameter name: SelectedIndex

How can I avoid this?

Thanks

John
 
Thanks for the response.

My workaround is just set the SelectionMode to a value other than None
in FormClosing event.

But I just think it is a bug when disposing the ListBox.
 
Back
Top