Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Tue Jan 27, 2009 8:53 am Post subject: HOWTO: Show a bitmap for a menu item |
|
|
Use the following code in the PopupContextMenu event of the FolderView Control to show a bitmap for a menu item :
[C#]
Code: | private void fldrView_PopupContextMenu(object sender, LogicNP.FolderViewControl.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 fldrView_PopupContextMenu(ByVal sender As Object, ByVal e As LogicNP.FolderViewControl.PopupContextMenuEventArgs)
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 |
|
|