You can add an icon to a menu item at design time or through code.
Use the following code to add an icon to a menu:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
'Create a new instance of a Bitmap and assign it to the Image property of the Command Object c1Command1.Image = new System.Drawing.Bitmap(@'D:\componentOne\Images\App.ico') |
To write code in C#
C# |
Copy Code
|
---|---|
//Create a new instance of a Bitmap and assign it to the Image property of the Command Object c1Command1.Image = new System.Drawing.Bitmap(@"D:\componentOne\Images\App.ico"); |