Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Tue Jan 27, 2009 8:55 am Post subject: HOWTO: Show a bitmap for a menu item |
|
|
Use the following code in the PopupContextMenu event of the FileView Control to show a bitmap for a menu item :
[C#]
Code: | private void flView_PopupContextMenu(object sender, LogicNP.FileViewControl.PopupContextMenuEventArgs e)
{
ShellMenuItem newMenuItem = e.ShellMenu.AddItem("Custom Menu Item");
//Set the path of the bitmap file here
newMenuItem.SetBitmap(new Bitmap("C:\\mybitmap.bmp"));
} |
[VB.Net]
Code: | Private Sub flView_PopupContextMenu(ByVal sender As System.Object, ByVal e As LogicNP.FileViewControl.PopupContextMenuEventArgs) Handles flView.PopupContextMenu
Dim newMenuItem As ShellMenuItem = e.ShellMenu.AddItem("SubMenu")
'Set the path of the bitmap file here
newMenuItem.SetBitmap(New Bitmap("C:\\mybitmap.bmp"))
End Sub |
|
|