ComboBox SelectedIndex Property Changes when changing Visible property

M

mike

Hi,

I'd like advice from a .NETer. I have a loadcombo
routine which sets the selectedindex to -1 if it's an "add
record", but then it goes to a security routine which,
based on permissions sets the visible property. When the
visible property is set..

'Petition Type
lblPetitionType.Visible = False
cboPetitionType.Visible = True

... and after this line of code then it sets the
selectedindex to 0. Why does it do this, and how can I
stop it without rearranging all of my code.

Thanks for your help.

Mike
 
C

Craig Vick [MSFT]

Hi Mike,

In a simple app (with a ComboBox and a Button) I'm not able to repro what
you're seeing. Once I set SelectedIndex to -1, it stays -1.

Craig
VB.NET Team
 

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