Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSkinController.OnPopupSysMenu Event

In This Article

Enables you to customize the system menu displayed for a skinned form.

#Declaration

Delphi
property OnPopupSysMenu: TdxSkinPopupSysMenuEvent read; write;

#Remarks

This event is raised before the system menu is displayed for a form passed as the AForm parameter. Use the ASysMenu parameter to access the system menu and customize its items.

The following code demonstrates how to add custom items to the system menu by handling the OnPopupSysMenu event.

Delphi
type
  TForm1 = class(TForm)
  // ...
  private
    procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
  // ...
  end;
implementation
const
  SC_CustomMenuItem = WM_USER + 1;
procedure TForm1.dxSkinController1PopupSysMenu(Sender: TObject; AForm: TCustomForm; ASysMenu: HMENU);
begin
  // Add a separator to the menu
  AppendMenu(ASysMenu, MF_SEPARATOR, 0, '');
  // Add a custom menu item to the menu
  AppendMenu(ASysMenu, MF_STRING, SC_CustomMenuItem, 'Custom Item');
end;
procedure TForm1.WMSysCommand(var Msg : TWMSysCommand);
begin
  if Msg.CmdType = SC_CustomMenuItem then
    // Handle clicks on the custom menu item here
  else
   inherited;
end;
See Also