Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Mon Jan 26, 2009 11:15 am Post subject: HOWTO: Show a bitmap for a menu item |
|
|
Use the following code in the GetMenuItems method to show a bitmap for a menu item :
Code: | [C#]
public override void GetMenuItems(GetMenuitemsEventArgs e)
{
ShellMenuItem menuitem = e.Menu.AddItem("Context menu Item", "contextmenuitem", string.Empty);
//Set the path to your .bmp file here
menuitem.SetBitmap(new Bitmap("c:\\mybitmap.bmp"));
} |
Code: | [vb.Net]
Public Overrides Sub GetMenuItems(ByVal e As GetMenuitemsEventArgs)
Dim menuitem As ShellMenuItem = e.Menu.AddItem("Context menu Item", "contextmenuitem", String.Empty)
'Set the path to your .bmp file here
menuitem.SetBitmap(New Bitmap("c:\mybitmap.bmp"))
End Sub |
|
|