Strange combo box functionality

E

Edward

I have encountered a combo box acting with a mind of its own in a
VB.NET Windows app.

I have a wizard consisting of a tab control; depending on which page
is being displayed the tabs are added or removed.

On page 1 of the wizard I have a combo box which is populated via its
datasource using an array.

I show page 1 and choose an item in the combo box (other than the 1st
item) and then proceed onto the next page. This is where it gets
strange.

If I go back to page 1 without entering any data on page 2 the value
in the combo is still as before.

If I go back to page 1 after entering some data on page 2 the value in
the combo has changed to the 1st value in the combo. (NB. No combo
change events are fired in this step)

To prove it wasn't something in my code messing it up, I moved the
combo box off the tab control and repeated the tests. The value in the
combo remained the same.

Conclusion: The only thing that makes sense to me is that the tab
control is causing the combo to refresh under certain circumstances
(could be the adding or removing of the tabs in the tab control).

Any thoughts, anyone?

Edward
 
C

CJ Taylor

Removing the tabs will force a repaint.

Which is why your probably losing values.

-CJ
 

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