Unit 'MUIClass.Window' Package
[Overview][Types][Classes][Index] [#MUIClass]

TMUIWindow.Menustrip

[i] Specify a menu strip object for this window.

Declaration

Source position: MUIClass.Window.pas line 149

published property TMUIWindow.Menustrip : TMUINotify
  read FMenuStrip
  write SetMenuStrip;

Description

The object is treated as a child of the window and will be disposed when the window is disposed.

Menustrip objects defined for a window will override an MUIApp.MenuStrip object.

If you have a global menu for all your applications windows but you want some windows to have no menu, use the NoMenus field.

Example:

Window.MenuStrip := TMUIMenuStrip.Create;

Men := TMUIMenu.Create;
with Men do
begin
  Title := 'Test Menu';        // Name of Menu (thats the one in the ScreenBar)
  Parent := MUIApp.MenuStrip;  // attach to the Menustrip
end;

with TMUIMenuItem.Create do
begin
  Title := 'Config';         // Text on the menu item
  Parent := Men;             // attach to the Menu
  OnTrigger := @ConfigStart; // Event to call when selected
end;

with TMUIMenuItem.Create do
begin
  Title := 'Quit';
  Parent := Men;
  OnTrigger := @QuitMe;
end;

See also

NoMenus

  

Temporarily disable the menu strip of a window.

MUIApp.MenuStrip


Documentation generated on: 2022-07-30