I have noticed the following problem. If you try to expand the drop-down
list of a ComboBox (DropDownStyle=DropDown) with no items and immediately
attempt to click another control (displayed underneath the combo box, not
sure about other locations), nothing will happen. It takes several mouse
clicks before you are finally able to select other dialog controls. My guess
is that the combo box gets expanded, but since there are no items, the user
does not see the list box portion of it, so if the user tries to click a
check box, a button or some other control, this mouse click is obstructed by
the expanded (but not visible) list box (this is just a guess, so it may
happen for a totally different reason). This is very confusing for the
customer, because it appears like the dialog is hanging (i.e. there is no
response to the mouse clicks). Is this a known issue? Is there a workaround?

Thanks,

Alek

Re: Expamding empty ComboBox problem by 100

100
Thu Jan 22 13:42:13 CST 2004

Hi Alek,
It takes two clicks.
Even though the combobox is empty it shows dorop-down list with one empty
line. If you click inside the bounderies of the list it won't get closed and
it will look like nothing happens. This list might be hard to see (for
example if you have an edit box under the combobox and both has white
background color) and this might be your problem. Look carefully for the
thin black border that the cobobox' list has (or jsut for the test change
the BackColor of the combobox).
If you don't click on the list it takes two clicks. One to close the list
and one to switch the focus.

HTH
B\rgds
100
"Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
news:um31UmR4DHA.536@tk2msftngp13.phx.gbl...
> I have noticed the following problem. If you try to expand the drop-down
> list of a ComboBox (DropDownStyle=DropDown) with no items and immediately
> attempt to click another control (displayed underneath the combo box, not
> sure about other locations), nothing will happen. It takes several mouse
> clicks before you are finally able to select other dialog controls. My
guess
> is that the combo box gets expanded, but since there are no items, the
user
> does not see the list box portion of it, so if the user tries to click a
> check box, a button or some other control, this mouse click is obstructed
by
> the expanded (but not visible) list box (this is just a guess, so it may
> happen for a totally different reason). This is very confusing for the
> customer, because it appears like the dialog is hanging (i.e. there is no
> response to the mouse clicks). Is this a known issue? Is there a
workaround?
>
> Thanks,
>
> Alek
>
>



Re: Expamding empty ComboBox problem by Alek

Alek
Thu Jan 22 13:56:48 CST 2004

Thanks for the reply. You are right: it takes two clicks. And I kind of
understand why, but I would like to fix it because for an unexpecting user,
this may be frustrating, since the list box is totally invisible. I mean
there are no thin or thick borders, the UI stays exactly the same (I have a
caret blinking in the text field of the combo box). Also I checked the state
of the DropDown property in the DropDown event handler and it is set to
false(?!). And I do not have any other controls which would interfere with
the drop-down list. Anyway, I am thinking if I can programmatically perform
a click in the DropDown event handler (after detecting that there are no
items there), logically, it should do the trick. Not sure if it will or how
to do this, though.

Alek

"100" <100@100.com> wrote in message
news:uiT0Z%23R4DHA.1868@TK2MSFTNGP10.phx.gbl...
> Hi Alek,
> It takes two clicks.
> Even though the combobox is empty it shows dorop-down list with one empty
> line. If you click inside the bounderies of the list it won't get closed
and
> it will look like nothing happens. This list might be hard to see (for
> example if you have an edit box under the combobox and both has white
> background color) and this might be your problem. Look carefully for the
> thin black border that the cobobox' list has (or jsut for the test change
> the BackColor of the combobox).
> If you don't click on the list it takes two clicks. One to close the list
> and one to switch the focus.
>
> HTH
> B\rgds
> 100
> "Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
> news:um31UmR4DHA.536@tk2msftngp13.phx.gbl...
> > I have noticed the following problem. If you try to expand the drop-down
> > list of a ComboBox (DropDownStyle=DropDown) with no items and
immediately
> > attempt to click another control (displayed underneath the combo box,
not
> > sure about other locations), nothing will happen. It takes several mouse
> > clicks before you are finally able to select other dialog controls. My
> guess
> > is that the combo box gets expanded, but since there are no items, the
> user
> > does not see the list box portion of it, so if the user tries to click a
> > check box, a button or some other control, this mouse click is
obstructed
> by
> > the expanded (but not visible) list box (this is just a guess, so it may
> > happen for a totally different reason). This is very confusing for the
> > customer, because it appears like the dialog is hanging (i.e. there is
no
> > response to the mouse clicks). Is this a known issue? Is there a
> workaround?
> >
> > Thanks,
> >
> > Alek
> >
> >
>
>



Re: Expamding empty ComboBox problem by Alek

Alek
Thu Jan 22 14:24:24 CST 2004

OK, I fixed it by doing just that: in the DropDown event handler, check if
the number of items is 0, and if so, send the mouse click event to the combo
box. If you need to do the same, here is the sample code:

using System.Runtime.InteropServices;
...
// Dialog class
class ...
{
private const UInt32 WM_LBUTTONDOWN = 0x201;
private const UInt32 WM_LBUTTONUP = 0x202;

[DllImport("user32.dll")]
private static extern int SendMessage(IntPtr handle, UInt32 message, int
wParam, int lParam);
...
private static void SendClick(Control target)
{
if (target == null)
return;

SendMessage(target.Handle, WM_LBUTTONDOWN, 0, 0);
SendMessage(target.Handle, WM_LBUTTONUP, 0, 0);
}

private void comboBox_DropDown(object sender, System.EventArgs e)
{
if (((ComboBox)sender).Items.Count == 0)
SendClick((Control)sender);
}
...
}

Enjoy,

Alek

"Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
news:Ol8fgHS4DHA.1816@TK2MSFTNGP12.phx.gbl...
> Thanks for the reply. You are right: it takes two clicks. And I kind of
> understand why, but I would like to fix it because for an unexpecting
user,
> this may be frustrating, since the list box is totally invisible. I mean
> there are no thin or thick borders, the UI stays exactly the same (I have
a
> caret blinking in the text field of the combo box). Also I checked the
state
> of the DropDown property in the DropDown event handler and it is set to
> false(?!). And I do not have any other controls which would interfere with
> the drop-down list. Anyway, I am thinking if I can programmatically
perform
> a click in the DropDown event handler (after detecting that there are no
> items there), logically, it should do the trick. Not sure if it will or
how
> to do this, though.
>
> Alek
>
> "100" <100@100.com> wrote in message
> news:uiT0Z%23R4DHA.1868@TK2MSFTNGP10.phx.gbl...
> > Hi Alek,
> > It takes two clicks.
> > Even though the combobox is empty it shows dorop-down list with one
empty
> > line. If you click inside the bounderies of the list it won't get closed
> and
> > it will look like nothing happens. This list might be hard to see (for
> > example if you have an edit box under the combobox and both has white
> > background color) and this might be your problem. Look carefully for the
> > thin black border that the cobobox' list has (or jsut for the test
change
> > the BackColor of the combobox).
> > If you don't click on the list it takes two clicks. One to close the
list
> > and one to switch the focus.
> >
> > HTH
> > B\rgds
> > 100
> > "Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
> > news:um31UmR4DHA.536@tk2msftngp13.phx.gbl...
> > > I have noticed the following problem. If you try to expand the
drop-down
> > > list of a ComboBox (DropDownStyle=DropDown) with no items and
> immediately
> > > attempt to click another control (displayed underneath the combo box,
> not
> > > sure about other locations), nothing will happen. It takes several
mouse
> > > clicks before you are finally able to select other dialog controls. My
> > guess
> > > is that the combo box gets expanded, but since there are no items, the
> > user
> > > does not see the list box portion of it, so if the user tries to click
a
> > > check box, a button or some other control, this mouse click is
> obstructed
> > by
> > > the expanded (but not visible) list box (this is just a guess, so it
may
> > > happen for a totally different reason). This is very confusing for the
> > > customer, because it appears like the dialog is hanging (i.e. there is
> no
> > > response to the mouse clicks). Is this a known issue? Is there a
> > workaround?
> > >
> > > Thanks,
> > >
> > > Alek
> > >
> > >
> >
> >
>
>