Editare

Partajați prin


SystemIcons.GetStockIcon Method

Definition

Overloads

GetStockIcon(StockIconId, StockIconOptions)

Gets the specified Windows shell stock icon.

GetStockIcon(StockIconId, Int32)

Gets the specified Windows shell stock icon.

GetStockIcon(StockIconId, StockIconOptions)

Source:
SystemIcons.cs

Gets the specified Windows shell stock icon.

public static System.Drawing.Icon GetStockIcon (System.Drawing.StockIconId stockIcon, System.Drawing.StockIconOptions options = System.Drawing.StockIconOptions.Default);
static member GetStockIcon : System.Drawing.StockIconId * System.Drawing.StockIconOptions -> System.Drawing.Icon
Public Shared Function GetStockIcon (stockIcon As StockIconId, Optional options As StockIconOptions = System.Drawing.StockIconOptions.Default) As Icon

Parameters

stockIcon
StockIconId

The stock icon to retrieve.

options
StockIconOptions

A bitwise combination of the enumeration values that specifies options for retrieving the icon.

Returns

The requested Icon.

Exceptions

stockIcon is an invalid StockIconId.

Remarks

Unlike the static icon properties in SystemIcons, this API returns icons that are themed for the running version of Windows. Additionally, the returned Icon is not cached and should be disposed when no longer needed.

Applies to

GetStockIcon(StockIconId, Int32)

Source:
SystemIcons.cs

Gets the specified Windows shell stock icon.

public:
 static System::Drawing::Icon ^ GetStockIcon(System::Drawing::StockIconId stockIcon, int size);
public static System.Drawing.Icon GetStockIcon (System.Drawing.StockIconId stockIcon, int size);
static member GetStockIcon : System.Drawing.StockIconId * int -> System.Drawing.Icon
Public Shared Function GetStockIcon (stockIcon As StockIconId, size As Integer) As Icon

Parameters

stockIcon
StockIconId

The stock icon to retrieve.

size
Int32

The desired size. If the specified size does not exist, an existing size will be resampled to give the requested size.

Returns

The requested Icon.

Applies to