-
Creating and Displaying an UIContextMenu [Janus UI and Ribbon Controls v3.5 for .NET]
The following code shows how to create and display a context menu in code.
In VB:
Dim ctMenu As UIContextMenu = New UIContextMenu()
'Create the commands that will be added to the context menu
Dim cutCommand As UICommand = New UICommand("Cut", "Cu&t")
Dim copyCommand As UICommand = New UICommand("Copy", "Cop&y")
Dim pasteCommand As UICommand = New UICommand("Paste", "&Paste")
'Add the commands to the Commands collection of the context menu
ctMenu.Commands.Add(cutCommand)
ctMenu.Commands.Add(copyCommand)
ctMenu.Commands.Add(pasteCommand)
'Call the Show method to display the context menu.
ctMenu.Show()
In C#:
UIContextMenu ctMenu = new UIContextMenu();
//Create the commands that will be added to the context menu
UICommand cutCommand = new UICommand("Cut", "Cu&t");
UICommand copyCommand = new UICommand("Copy", "Cop&y");
UICommand pasteCommand = new UICommand("Paste", "&Paste");
//Add the commands to the Commands collection of the context menu
ctMenu.Commands.Add(cutCommand);
ctMenu.Commands.Add(copyCommand);
ctMenu.Commands.Add(pasteCommand);
//Call the Show method to display the context menu.
ctMenu.Show();
Source Of Information : Janus v3.5 Help Files for VS 2008
Subscribe to:
Post Comments (Atom)
0 comments: