C# Add Checkbox To WinForms Context Menu

前端 未结 4 2108
一整个雨季
一整个雨季 2021-01-02 08:21

I have a series of checkboxes on a form. I want to be able to select these from a context menu as well as the form itself. The context menu is linked to the system tray icon

4条回答
  •  悲哀的现实
    2021-01-02 08:52

    Well, a menu item has the "Checked" property, which can make it behave like a checkbox. When you click a menu item, you can programmatically toggle the state of the corresponding checkbox on your form.

    You can also use the Opening event of the context menu to set the Checked state of the menu items based on the checked state of the checkboxes.

提交回复
热议问题