SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE [dbo].[MenuItems]
  2. (
  3. [MenuID] [int] IDENTITY(1,1) NOT NULL,
  4. [MenuTitle] [nvarchar](50) NOT NULL,
  5. [MenuIdParent] [int] NULL,
  6. [MenuEventHandler] [nvarchar](50) NULL,
  7. [MenuLanguageID] [int] NOT NULL
  8.  ) ON [PRIMARY]
  9.  GO
  10.  ALTER TABLE [dbo].[MenuItems] ADD  CONSTRAINT [DF_MenuItems_MenuLanguageID]  DEFAULT ((1)) FOR [MenuLanguageID]
  11.  GO
  12.    
  13. List<string> menuItems = LoadUserMenuItems();
  14.         ContextMenuStrip menu = new ContextMenuStrip();
  15.         menu.Dock = DockStyle.Fill;
  16.         foreach (var menuItem in menuItems)
  17.         {
  18.             MenuItem item = new MenuItem(menuItem);
  19.             item.Text = menuItem;
  20.             item.Click += new EventHandler(item_Click);// item_click is event handler name
  21.             // item.MenuItems.Add(); you could use this to add sub items
  22.         }
  23.  
  24.         panel1.Controls.Add(menu);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top