
Delphi的TMainMenu如何展开指定的子菜单?
例如已知某个Item1:TMenuItem然后要求在某个方法中(如Button1Click)将它展开(或者将它所在的上层菜单展开)...
例如已知某个Item1: TMenuItem
然后要求在某个方法中(如Button1Click)将它展开(或者将它所在的上层菜单展开) 展开
然后要求在某个方法中(如Button1Click)将它展开(或者将它所在的上层菜单展开) 展开
展开全部
BOOL TrackPopupMenu(
HMENU hMenu, // handle to shortcut menu
UINT uFlags, // screen-position and mouse-button flags
int x, // horizontal position, in screen coordinates
int y, // vertical position, in screen coordinates
int nReserved, // reserved, must be zero
HWND hWnd, // handle to owner window
CONST RECT *prcRect // ignored
);
procedure TForm1.Button1Click(Sender: TObject);
var
X,Y:integer;
P:Tpoint;
begin
p.X:= 0;
p.Y:= 0;
P:= ClientToScreen(P);
TrackPopupMenu(item1.Handle,TPM_LEFTALIGN,P.X,P.Y,0,handle,0);
end;
HMENU hMenu, // handle to shortcut menu
UINT uFlags, // screen-position and mouse-button flags
int x, // horizontal position, in screen coordinates
int y, // vertical position, in screen coordinates
int nReserved, // reserved, must be zero
HWND hWnd, // handle to owner window
CONST RECT *prcRect // ignored
);
procedure TForm1.Button1Click(Sender: TObject);
var
X,Y:integer;
P:Tpoint;
begin
p.X:= 0;
p.Y:= 0;
P:= ClientToScreen(P);
TrackPopupMenu(item1.Handle,TPM_LEFTALIGN,P.X,P.Y,0,handle,0);
end;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不是mainmenu吧?popumenu才这样用。
追问
其实是在一个线程里用的,在特定的时间把特定菜单展开并且显示Hint框(后面这步已经解决),起到“帮助”、“向导”这样的功能。
现在是用组合键消息“Alt+字母”暂时解决的,想问问是否有更严谨的处理方式。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
visual:=true;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询