Board index » delphi » problem when poping up a menu on mouseup of a speedbutton

problem when poping up a menu on mouseup of a speedbutton

Hello,

I have to popup a menu on the onmouseup event of a tspeedbutton that is
flat (because the onclick doesn't know which button - left or right - was
pressed). My problem is that when the menu is pop and then i click out of it in
my form (doesnt happen if i click on the menu or out of my form), the menu
dissappears as normally, but the speedbutton is still as if the cursor was over
it (not flat, but raised). I tried to update or refresh it but it doesnt work.
Could u help me?

Thanks

Thomas

 

Re:problem when poping up a menu on mouseup of a speedbutton


Instead of using OnMouseUp, you can use OnClick. To do this, define a
private variable, e.g. leftButton : boolean, and in the OnMouseDown event
put leftButton := Button = mbLeft. You can then test leftButton in the
OnClick.

Quote
Marie Delagarde <mdelaga...@cipcinsa.insa-lyon.fr> wrote in message

news:7i156r$km7$3@tempo.univ-lyon1.fr...
Quote
> Hello,

> I have to popup a menu on the onmouseup event of a tspeedbutton that is
> flat (because the onclick doesn't know which button - left or right - was
> pressed). My problem is that when the menu is pop and then i click out of
it in
> my form (doesnt happen if i click on the menu or out of my form), the menu
> dissappears as normally, but the speedbutton is still as if the cursor was
over
> it (not flat, but raised). I tried to update or refresh it but it doesnt
work.
> Could u help me?

> Thanks

> Thomas

Other Threads