ComboBox BUG! Any fixes?

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

Guest

I have a bug with combobox which is reproduced by the following steps:

Create a form with a Tabcontrol and two tabs.
On one tab place a combo box and give it the entries one, two and three.
Change the anchor property of the combo to anything other than the default.
Leave all other properties alone.
Run the app. fill the combo with 't' switch tabs and switch back.
The text in the combo now says three
(it should just say 't')

Any help in solving this would be much appreciated.

Thanks!
 
Mark said:
I have a bug with combobox which is reproduced by the following steps:

Create a form with a Tabcontrol and two tabs.
On one tab place a combo box and give it the entries one, two and three.
Change the anchor property of the combo to anything other than the
default.
Leave all other properties alone.
Run the app. fill the combo with 't' switch tabs and switch back.
The text in the combo now says three
(it should just say 't')

Any help in solving this would be much appreciated.

Thanks!
You don't say which version/edition of Visual Studio you are using, nor the
project type. I tried to reproduce your symptom using Visual Studio 2005,
Professional Edition to create a VB Windows project. I was unable to produce
the results you describe. When I switched back to the tab with the combo
box, the 't' I entered was still displayed.
However, if I do the same thing using Visual Studio .NET 2003, Professional
Edition, I produce a symptom similar to yours. After entering 't' in the
combo box and switching tabs, I see "two" displayed. If I type 'o' into the
combo box and switch, "one" is displayed.
Other results:
Entered Displayed After Switching Tabs
"tw" "two"
"th" "three"
"on" "one"
"oneaa" "oneaa"
"twenty" "two"
So, it appears that the combo box is refreshing itself based on a character
by character comparison of the text property with items in the items
collection and substituting if the text property contains a substring of one
of the items.
It would appear to be a bug that has been fixed in VS 2005.
Unfortunately, I don't have a "fix". Hopefully, somebody else can shed more
light.
 
hi Peter

Thanks for the reply - yes big oops regarding the missing version
information - we are indeed using VS 2003. Unfortunately moving to 2005 isn't
a viable option at the moment due to the size of our project.

Looks like it has something to do with the resize event, i.e. anchoring the
combo left and right and just place on a form, type 't' and all is ok until
the form is resized and it goes wrong. We have tried subclassing and
overriding the anchor property and working the resize of the control
ourselves - this has resolved the tab situation but the resize on a form
still goes wrong.
 
hi Peter

Thanks for the reply - yes big oops regarding the missing version
information - we are indeed using VS 2003. Unfortunately moving to 2005 isn't
a viable option at the moment due to the size of our project.

Looks like it has something to do with the resize event, i.e. anchoring the
combo left and right and just place on a form, type 't' and all is ok until
the form is resized and it goes wrong. We have tried subclassing and
overriding the anchor property and working the resize of the control
ourselves - this has resolved the tab situation but the resize on a form
still goes wrong.
 
Back
Top