This is called as ContextMenu in coding terms. and I have written a simple code to add 2 menus items for right click menu i.e. ContextMenu
ContextMenu mnuContextMenu = new ContextMenu();
this.trackList.ContextMenu = mnuContextMenu;//trackList is the listview for me.
MenuItem mnuItemScroll = new MenuItem();
mnuItemScroll.Text = "&AutoScroll List";
MenuItem mnuItemCompare = new MenuItem();
mnuItemCompare.Text = "&Compare Files";
mnuContextMenu.MenuItems.Add(mnuItemScroll);
mnuContextMenu.MenuItems.Add(mnuItemCompare);
ContextMenu mnuContextMenu = new ContextMenu();
this.trackList.ContextMenu = mnuContextMenu;//trackList is the listview for me.
MenuItem mnuItemScroll = new MenuItem();
mnuItemScroll.Text = "&AutoScroll List";
MenuItem mnuItemCompare = new MenuItem();
mnuItemCompare.Text = "&Compare Files";
mnuContextMenu.MenuItems.Add(mnuItemScroll);
mnuContextMenu.MenuItems.Add(mnuItemCompare);
No comments:
Post a Comment