Board index » delphi » Detecting drop up or drop down of TCombobox

Detecting drop up or drop down of TCombobox

Hello

Does anybody know how I can detect whether the drop down list box of  a
combobox has been 'dropped up' or 'dropped down'?

i.e When the drop down list of a combo box drops off the bottom of the
screen it is automatically moved so that the drop down effectively becomes a
drop up and the list is displayed above the combo box control instead of
below

Background :

I have the style of the combo set to csOwnerDrawFixed and have written an
OnDrawItem event so that when the mouse hovers over an item in the list a
hint is displayed to the right hand side of the item.

I have extended the functionality so that if the form is moved close enough
to the right hand side of the screen, so that the hint would be displayed
offscreen, the hint is shifted to the left hand side of the item (and vice
versa).

This works really well

But...

When the combo box drop down list becomes a 'drop up' list I need to offset
my hints so that they appear above the combo box as well. I have no problems
in offsetting the hints and judging the correct distances but I simple
cannot detect whether the drop down is either up or down.

Any help would be greatly appreciated - It is really frustrating me!!

Matt

 

Re:Detecting drop up or drop down of TCombobox


Couldn't you do what the combobox does? Work out how big the combobox is,
then see if it would fit on the screen if it dropped down. If it would not
fit, you know that the combobox has dropped up!

Cheers,
Nick

Quote
"Matt Barnett" <matt.barn...@ntlworld.com> wrote in message

news:aie80u$19ti$1@sp15at20.hursley.ibm.com...
Quote
> Hello

> Does anybody know how I can detect whether the drop down list box of  a
> combobox has been 'dropped up' or 'dropped down'?

> i.e When the drop down list of a combo box drops off the bottom of the
> screen it is automatically moved so that the drop down effectively becomes
a
> drop up and the list is displayed above the combo box control instead of
> below

> Background :

> I have the style of the combo set to csOwnerDrawFixed and have written an
> OnDrawItem event so that when the mouse hovers over an item in the list a
> hint is displayed to the right hand side of the item.

> I have extended the functionality so that if the form is moved close
enough
> to the right hand side of the screen, so that the hint would be displayed
> offscreen, the hint is shifted to the left hand side of the item (and vice
> versa).

> This works really well

> But...

> When the combo box drop down list becomes a 'drop up' list I need to
offset
> my hints so that they appear above the combo box as well. I have no
problems
> in offsetting the hints and judging the correct distances but I simple
> cannot detect whether the drop down is either up or down.

> Any help would be greatly appreciated - It is really frustrating me!!

> Matt

Other Threads