Combobox properties  
Author Message
leicke





PostPosted: Top

Visual Basic [VB] >> Combobox properties

This is a multi-part message in MIME format.

------=_NextPart_000_005D_01C4BA7B.4460E100
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Just a small silly question:

I've bounded a couple of comboboxes to a dataset and upon loading them, =
I see the first Item being displayed.
which is what i expect.

However another combobox which get populated from the column names of a =
specific table in the (same) dataset, the first item you see is an empty =
text (blanc).
The number of items is the correct one (I've verified this).

So, I had to force it to display the first Item when it loads:
myCombo.Text =3D myCombo.Items(0)

and it works fine.=20

However I am curious to know.=20

The design properties of both boxes are the same. why this difference? =
Is it the way I am populating them?

TIA

------=_NextPart_000_005D_01C4BA7B.4460E100
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Just a small silly =
question:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've bounded a couple of comboboxes to =
a dataset=20
and upon loading them, I see the first Item being =
displayed.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>which is what i expect.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>However another combobox which get =
populated from=20
the column names of a specific table in the (same) dataset, the first =
item you=20
see is an empty text (blanc).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The number of items is the correct one =
(I've=20
verified this).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>So, I had to force it to display the =
first Item=20
when it loads:</FONT></DIV>
<DIV>
<P><FONT face=3DArial size=3D2>myCombo.Text =3D =
myCombo.Items(0)</FONT></P>
<P><FONT face=3DArial size=3D2>and it works fine. </FONT></P>
<P><FONT face=3DArial size=3D2>However I am curious to know. </FONT></P>
<P><FONT face=3DArial size=3D2>The design properties of both boxes are =
the same. why=20
this difference? Is it the way I am populating them?</FONT></P>
<P><FONT face=3DArial size=3D2>TIA</FONT></P></DIV></BODY></HTML>

------=_NextPart_000_005D_01C4BA7B.4460E100--

Visual Studio24