如何添加或删除actionMenuBar的windowMenu选项

时间:2012-11-08 16:32:53

标签: delphi

我想知道,如何添加或删除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;

1 个答案:

答案 0 :(得分:3)

type
  ActionMainMenuBarAccess = class(TActionMainMenuBar);

procedure TForm2.Button2Click(Sender: TObject);
begin
  ActionMainMenuBar1.WindowMenu := '';
  ActionMainMenuBarAccess(ActionMainMenuBar1).FWindowMenuItem := nil;
  ActionMainMenuBarAccess(ActionMainMenuBar1).RefreshMDIMenu;
end;

另见QualityCentral report