Board index » delphi » Popup menu calling popup

Popup menu calling popup

How can get the proper screen cords for a contorl so manually calling
Popup will place the popup menu next to the control you want.

Thanks ..

 

Re:Popup menu calling popup


Steve

Use the onmousedown event for whatever object the mouse is clicking :-

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  NewLabel: TLabel;
begin
  NewLabel := TLabel.Create(Form1);
  NewLabel.Parent := Self;
  NewLabel.Left := X;
  NewLabel.Top := Y;
  NewLabel.Caption := '(' + IntToStr(X) + ',' + IntToStr(Y) + ')';
  NewLabel.Visible := True;
end;

This gives you the coordinates, hope this helps

Tim Newton
http://www.btinternet.com/~timn

Quote
Steve Stone wrote:

> How can get the proper screen cords for a contorl so manually calling
> Popup will place the popup menu next to the control you want.

> Thanks ..

Re:Popup menu calling popup


In article <3469e966.10808...@news.xs4all.nl>,

Quote
r...@xs4all.removeallthis.nl (rene veerman) writes:
>Can tLabel do this? If it can, I think you should set tlabel.brush to
>a specific color, but which color-constant do i use for it?

>If tLabel can't, please point me to a 3rd party component that can..

Code . . .
Label1.Transparent := true;

Its in the Delphi Help file under TLabel / Properties / Transparent

There's quite a lot of good information in there on other matters too.

Alan Lloyd
alangll...@aol.com

Other Threads