Board index » cppbuilder » Button problem when combo box dropped down

Button problem when combo box dropped down

Could anyone tell me if there is a way round this problem?
I have a form with a combo box on it and a button to close the window.
If the combobox is dropped down, I have to click the Close button twice to make it operate. The first click closes the dropdown list.

Any thoughts?

Cheers,

David C Ayre

 

Re:Button problem when combo box dropped down


"David C Ayre" <DavidCAyre> wrote in message
news:3e884b8b$1@newsgroups.borland.com...
Quote
> I have a form with a combo box on it and a button to close the
window.
> If the combobox is dropped down, I have to click the Close button

twice to make it operate. The first click closes the dropdown list.

This behavior is, as they say, "by design".  When a Windows (not just
a BCB/VCL) combobox is dropped-down, the mouse is Captured by the
control expressly to receive the next click *anywhere* and close the
drop-down.  All apps behave this way, so it can be argued that yours
should not change the behavior.

If you are certain you want to change it, perhaps you could take my
subclassed combobox code at
http://home.att.net/~secondcut/nitecomb.htm , eliminate everything
except the test for "where is the mouse?", make sure you have the
*screen* coordinates of the click that was outside the box, and Post
(*not* Send) that click message before doing the default combobox
processing.  There's a limit to what you can do in the subclasss
because the combobox still has focus, and a lot of processing yet to
be done.

--
Timothy H. Buchman
========================================
City Center Theater, New York NY
mail address tbuchmanPLEASE(at sign)REMOVEcitycenter.org
Search .borland message archive on http://www.mers.com/searchsite.html

Re:Button problem when combo box dropped down


Thanks Tim,

I thought that might be the case. It's not vital but just messy.
I used to use C++ 4.51 and this never happened so I swas just wondering if I'd missed something.

Thanks anyway for your help,

David

"Timothy H. Buchman" <tbuchmanREMOVE(at)PLEASEcitycenterDOTorg> wrote:

Quote
>"David C Ayre" <DavidCAyre> wrote in message
>news:3e884b8b$1@newsgroups.borland.com...
>> I have a form with a combo box on it and a button to close the
>window.
>> If the combobox is dropped down, I have to click the Close button
>twice to make it operate. The first click closes the dropdown list.

>This behavior is, as they say, "by design".  When a Windows (not just
>a BCB/VCL) combobox is dropped-down, the mouse is Captured by the
>control expressly to receive the next click *anywhere* and close the
>drop-down.  All apps behave this way, so it can be argued that yours
>should not change the behavior.

>If you are certain you want to change it, perhaps you could take my
>subclassed combobox code at
>http://home.att.net/~secondcut/nitecomb.htm , eliminate everything
>except the test for "where is the mouse?", make sure you have the
>*screen* coordinates of the click that was outside the box, and Post
>(*not* Send) that click message before doing the default combobox
>processing.  There's a limit to what you can do in the subclasss
>because the combobox still has focus, and a lot of processing yet to
>be done.

>--
>Timothy H. Buchman
>========================================
>City Center Theater, New York NY
>mail address tbuchmanPLEASE(at sign)REMOVEcitycenter.org
>Search .borland message archive on http://www.mers.com/searchsite.html

Other Threads