我想知道,如何添加或删除actionMenuBar组件的windowMenu选项,我有一个mdi应用程序,可以添加该选项,但以后无法删除它
对不起我的英语
我有这个:
//add windowmenu and works fine
procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.ActionMainMenuBar1.WindowMenu := '&Ventana';
end;
//remove windowmenu but dont work
procedure TForm2.Button2Click(Sender: TObject);
begin
Form1.ActionMainMenuBar1.WindowMenu := '';
end;
最佳答案
type
ActionMainMenuBarAccess = class(TActionMainMenuBar);
procedure TForm2.Button2Click(Sender: TObject);
begin
ActionMainMenuBar1.WindowMenu := '';
ActionMainMenuBarAccess(ActionMainMenuBar1).FWindowMenuItem := nil;
ActionMainMenuBarAccess(ActionMainMenuBar1).RefreshMDIMenu;
end;
另请参见此QualityCentral report。