Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

Get coordinates of a component

I am dropping a popup menu on left click of a button.  I need to drop it from the lower left corner of the button.  I've found a SIMILAR question here:
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_10087977.html?query=popup+menu+left+click&topics=85

I was not able to glean the answer from the answer of that question.  Help!
0
hibbidiji
Asked:
hibbidiji
  • 3
  • 2
1 Solution
 
ZhaawZSoftware DeveloperCommented:
procedure TForm1.Button1Click(Sender: TObject);
var
  p : TPoint;
begin
p := Button1.ClientOrigin;
with p, button1 do PopupMenu1.Popup(x, y + height);
end;
0
 
hibbidijiAuthor Commented:
love it, thanks! next time try to answer a little faster, I had to wait almost 40 minutes at almost 4 in the morning!  I expect you experts to be giving perfect answers within 5 minutes!

Joking - thanks for the lightning fast response!
0
 
ZhaawZSoftware DeveloperCommented:
even shorter:

procedure TForm1.Button1Click(Sender: TObject);
begin
with Button1, ClientOrigin do PopupMenu1.Popup(x, y + height);
end;
0
 
ZhaawZSoftware DeveloperCommented:
Will you accept an answer? Or there's something else you want to ask? :)
0
 
hibbidijiAuthor Commented:
Another time where I was so excited about the answer that I thought i DID accept it!

Thanks again
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now