public void AddCheckItem(string name, Action <IntPtr> click = null) { MenuStripCheckItem item = new MenuStripCheckItem(uiMenuAppendCheckItem(Handle, name)); if (click != null) { item.Click += (sender, args) => { if (args != null) { click(args.Data); } }; } Items.Add(item); }
public void AddCheckItem(string name, Action <IntPtr> click = null) { IntPtr strPtr = name.ToLibuiString(); MenuStripCheckItem item = new MenuStripCheckItem(LibuiLibrary.uiMenuAppendCheckItem(Handle.DangerousGetHandle(), strPtr)); Marshal.FreeHGlobal(strPtr); if (click != null) { item.Click += (sender, args) => { if (args != null) { click(args.Data); } }; } Items.Add(item); }