Hi,
i want to show a popupmenu when click a button. but this procedure has error in Delphi XE.
procedure ShowPopupMenuEx(var mb1:TMouseButton;var X:integer;var Y:integer;var pPopUP:TPopupMenu);
var
popupPoint : TPoint;
begin
if (mb1 = mbLeft) then begin
popupPoint.X := x ;
popupPoint.Y := y ;
popupPoint := ClientToScreen(popupPoint); //Error Here
pPopUP.Popup(popupPoint.X, popupPoint.Y) ;
end;
end;
procedure TForm1.Button1MouseUp(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
begin
ShowPopupMenuEx(button,Button1.Left,Button1.Top,PopupMenu1); //Error Here
end;
when click button show this error :
[DCC Error] Form1.pas(205): E2010 Incompatible types: 'HWND' and 'TPoint' [DCC Error] Form1.pas(398): E2197 Constant object cannot be passed as var parameter [DCC Error] Form1.pas(398): E2197 Constant object cannot be passed as var parameter
have you any better way for show popupmenu, when click a button??
thanx.