共用方式為


IToolboxItemInfo.Icon Property

Gets the icon for the toolbox item as a file path, byte array, Bitmap, or IntPtr.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.Immutable.11.0 (in Microsoft.VisualStudio.Shell.Immutable.11.0.dll)

Syntax

'宣告
ReadOnly Property Icon As Object
Object Icon { get; }

Property Value

Type: System.Object

Remarks

This value can be any of the following, in order of decreasing efficiency (that is, you should prefer the lower-numbered options):

  1. The path to an image file (as a string).

  2. A byte array containing the bytes of an image file.

  3. A Bitmap object.

  4. A Win32 GDI bitmap handle (as an IntPtr).

For the file path and byte array, all GDI+ file types are supported: BMP, GIF, JPG, PNG and TIFF.

This property can be accessed on a background thread.

.NET Framework Security

See Also

Reference

IToolboxItemInfo Interface

Microsoft.VisualStudio.Shell Namespace