I have a windows form that contains a tab control. On
one of the tabs I have a combo box bound to a datatable.
When I first enter the tab I initialize the selectedindex
of the combobox to -1. I then type text into the combo
box that does not match any entries in the dropdown
list. If I then choose a different tab and return to my
tab with the combo box, the selectedindex has been
changed to 0 and the text I entered is replaced with the
text from list item 0. Why does the combo box not retain
a selectedindex of -1 with the text I entered? How can I
correct this?

Thank You,
Don

Re: Tab Control with Combo Box by Herfried

Herfried
Thu Sep 25 16:11:07 CDT 2003

Hello,

"Don" <DonBaril@hotmail.com> schrieb:
> I have a windows form that contains a tab control. On
> one of the tabs I have a combo box bound to a datatable.
> When I first enter the tab I initialize the selectedindex
> of the combobox to -1. I then type text into the combo
> box that does not match any entries in the dropdown
> list. If I then choose a different tab and return to my
> tab with the combo box, the selectedindex has been
> changed to 0 and the text I entered is replaced with the
> text from list item 0. Why does the combo box not retain
> a selectedindex of -1 with the text I entered? How can I
> correct this?

I have already heard about that bug (you are not the only one who
experiences it). I feel sorry, but I don't know a "fix".

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet



Re: Tab Control with Combo Box by Olivier

Olivier
Thu Sep 25 22:27:40 CDT 2003


Not sure if it is related but you could take a look at these two articles.

http://support.microsoft.com/default.aspx?scid=kb;en-us;327244

http://support.microsoft.com/default.aspx?scid=kb;en-us;814346

Olivier

Don wrote:

> I have a windows form that contains a tab control. On
> one of the tabs I have a combo box bound to a datatable.
> When I first enter the tab I initialize the selectedindex
> of the combobox to -1. I then type text into the combo
> box that does not match any entries in the dropdown
> list. If I then choose a different tab and return to my
> tab with the combo box, the selectedindex has been
> changed to 0 and the text I entered is replaced with the
> text from list item 0. Why does the combo box not retain
> a selectedindex of -1 with the text I entered? How can I
> correct this?
>
> Thank You,
> Don