By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

ComboBox .selectedindex not working?

P: n/a
Ok, I'm frustrated now. The simplest of things isn't working for me.

I have this in my form's load event (after the combo is populated):

If cmbCategory.SelectedIndex < 0 Then
cmbCategory.SelectedIndex = 0
End If

I want to always have the first thing in the list selected. It selects
it for a split second, then the combo is blanked.

I have the *exact* code in another form in the same project and it works
perfectly.

Heeeeelp!

--
- Mitchell Vincent
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mitchel,

Know that when you do this the selected index change event (or some equal to
that) is fired.

You are not the first with this problem.

You can greath recursive errors with this kind of code when it is in an
handled event section.

Cor
Nov 21 '05 #2

P: n/a
Cor Ligthert wrote:
Mitchel,

Know that when you do this the selected index change event (or some equal to
that) is fired.

You are not the first with this problem.

You can greath recursive errors with this kind of code when it is in an
handled event section.


Oh, I bet I know what is going on. I'm databinding the control. Duh.

Thanks Cor, helpful as usual!

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.