Adding a custom context menu item to Windows Form title bar

后端 未结 3 2056
攒了一身酷
攒了一身酷 2020-12-23 18:36

I found a thread on MSDN that shows how to add an item to the context menu of a winform title bar. Unfortunately it does not show how to register an event with the custom me

3条回答
  •  [愿得一人]
    2020-12-23 19:11

    For a separator just add:

    public const Int32 MF_SEPARATOR = 0x800;
    

    and in Form_load:

    InsertMenu(MenuHandle, 7, MF_BYPOSITION | MF_SEPARATOR, 0, string.Empty); // <-- Add a menu seperator
    

提交回复
热议问题