ListBox SelectionMode None ??

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
 
Q

Q. John Chen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top