470,636 Members | 1,858 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Wierd behavior of combo boxes on tab control

I have some very strange issues with combo boxes on a tab control.
Here's the scenario: I have a Windows Forms form that has a tab control
on it, with two (2) tabs. Tab 2 happens to have a number of text and
combo boxes on it (in panels on the tab). These combos were originally
simple drop down lists - i.e. you had to select from the list and
couldn't enter anything of your own. At that time everything worked

Now, the users decided that they wanted to be able to enter text into 6
of these combo boxes, and not be forced to select only from the list.
No problem, I thought, I simply switched the combo boxes from
DropDownList to DropDown (the commit/update logic didn't have to be
changed, thank goodness). When I load the boxes initially, I simply
read the database, load the items into the combo box collection, then
take whatever is specifed for this database record and set that in the
combo box Text field. That worked fine, EXCEPT for this one wierd
occurance: When you switch to that tab, ALL of these six combo boxes I
switched over to DropDown have their text selected! All are highlighted
and if I write a keypress event for one of these combo boxes, it shows
the selectedlength to be that of the length of the text - i.e. it is as
though a .SelectAll was done on each of these combo boxes; yet I never
do that anywhere in my code! I can un-select them by tabbing thru each
combo box - but then if I switch back to tab 1 and then back to tab 2,
lo and behold, every one of these combo boxes are reselected again!

I have banged my head against a wall trying to figure out why it is
doing this, but to no avail. I've went thru the code and don't see
anything that would account for this. I know my users are going to
complain if I put this into production acting like this. Anyone got any
ideas as to what .NET is doing and how to fix it? I don't know if this
is something stupid I am doing and just not seeing, or whether this is
an issue with the control and/or .NET framework.

Any advice/thoughts appreciated. BTW, this is being done in VS 2003,
..NET Framework 1.1, and Windows Forms.

Thanks in advance.



Jul 13 '06 #1
0 1409

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Ausclad | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.