select nothing in a listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I'm trying to set up defaults on a form, that populates a listbox, but with
no items selected when it first loads.
I have code where if an associated check box is checked, the listbox is
disabled, and selectedItem = Nothing. This works fine,
but on load, it always selects the 1st item in the list.

After populating my listbox, I use the code:
Me.lstCP.SelectedItem = Nothing
but it seems to make no difference...

Any suggestions?
Thanks,
Amber
 
If I am understanding you correctly, you just want to unselect everything.

This should do the trick:

ListBox1.SelectedIndex = -1

Jerel
 

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