5,388
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.ToolButton1Click(Sender: TObject);
var
APoint: TPoint;
begin
apoint:=toolbutton1.ClientToScreen(Point(toolbutton1.Left+toolbutton1.Width, toolbutton1.Top+toolbutton1.Height));
popupmenu1.Popup(apoint.X,apoint.y);
end;
procedure TForm1.ToolButton2Click(Sender: TObject);
var
APoint: TPoint;
begin
APoint := ToolButton2.ClientToScreen(Point(0, ToolButton2.ClientHeight));
TrackPopupMenu(PopupMenu1.Handle, TPM_BOTTOMALIGN , APoint.X, APoint.Y,
0, self.Handle, nil);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
rct:Trect;
begin
getwindowrect(button1.Handle,rct);
popupmenu1.Popup(rct.Right,rct.Bottom);
end;