Button.ClientOrigin.X
Button.ClientOrigin.Y

These properties give you the top-left cordinates of the component on the
screen

You could do something like this:

PopUpMenu.PopUp( Button.ClientOrigin.X, Button.ClientOrigin.Y +
Button.Height );

That worked with me.

Hope I helped ya !



----- Original Message ----- 
From: "Robert Meek" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 04, 2006 8:28 PM
Subject: Manual placement of popup menus D2006 Win32


> I need some help on this one!  What I have is a bank of BitBtn's
> stacked vertically in a Panel so that it looks a lot like a groupbar.  And
> before you ask, I tried handling this using a real groupbar, however it
> couldn't provide for other needs I have of it.  And so I decided to throw
> one together  as I'm now doing.
> Anyway, these bitbtn's have a width of 116.  And what I need is for
> a popup menu to appear beneath it with it's left edge aligned to the left
> edge of the bitbtn, and having the same exact width as the bitbtn.
Provided
> there is enough room for the entire menu to be displayed when it pops up,
it
> will do so beneath the bitbtn with it's top edge no more than a pixel
lower
> than the bottom edge of the bitbtn.  And if there isn't enough room, then
I
> want it to appear above the bitbtn, with the same alignments.
> I know I can use the menu's OnPopUp event but how do I position and
> set the width properly...and how do I determine if the menu should be
> displayed above or below it's bitbtn?  Thanx in advance!
>
> from Robert Meek dba Tangentals Design
>
>
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to