Setting ComboBox Value to Nothing in VB Code

  • Thread starter Thread starter Carl Tribble
  • Start date Start date
C

Carl Tribble

I want to set the value in the combo box so that it displays no text in the
visible portion and it returns a value of -1 for SelectedIndex. I have been
using:

ComboBoxName.SelectedIndex = -1

But this does not always work (sometimes, the selected index after executing
this line of code is actually 0 and therefore, of course, the first item in
the list is displayed.

TIA,
-Carl
 
Carl Tribble said:
I want to set the value in the combo box so that it displays no text in the
visible portion and it returns a value of -1 for SelectedIndex. I have
been using:

ComboBoxName.SelectedIndex = -1

But this does not always work (sometimes, the selected index after
executing this line of code is actually 0

BUG: ComboBox Does Not Clear When You Set SelectedIndex to -1
<URL:http://support.microsoft.com/?scid=kb;EN-US;327244>
 

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

Back
Top