예제 #1
0
        public void AddItem(string name, Action <IntPtr> click = null)
        {
            MenuStripItem item = new MenuStripItem(uiMenuAppendItem(Handle, name));

            if (click != null)
            {
                item.Click += (sender, args) =>
                {
                    if (args != null)
                    {
                        click(args.Data);
                    }
                };
            }
            Items.Add(item);
        }
예제 #2
0
        public void AddItem(string name, Action <IntPtr> click = null)
        {
            IntPtr        strPtr = name.ToLibuiString();
            MenuStripItem item   = new MenuStripItem(LibuiLibrary.uiMenuAppendItem(Handle.DangerousGetHandle(), strPtr));

            Marshal.FreeHGlobal(strPtr);

            if (click != null)
            {
                item.Click += (sender, args) =>
                {
                    if (args != null)
                    {
                        click(args.Data);
                    }
                };
            }
            Items.Add(item);
        }