SystemIcons 類別

定義

SystemIcons 類別的每一個屬性皆為整個 Windows 系統圖示的 Icon 物件。Each property of the SystemIcons class is an Icon object for Windows system-wide icons. 這個類別無法被繼承。This class cannot be inherited.

public ref class SystemIcons sealed
public sealed class SystemIcons
type SystemIcons = class
Public NotInheritable Class SystemIcons
繼承
SystemIcons

範例

下列程式碼範例示範如何從Icon控制碼載入點陣圖、 GraphicsUnit使用列舉, Round以及使用方法繪製點陣圖的矩形界限。The following code example demonstrates how to load a bitmap from an Icon handle, using the GraphicsUnit enumeration, and the use of the Round method to draw the rectangle bounds of a bitmap.

這個範例是設計來與 Windows Forms 搭配使用。This example is designed to be used with Windows Forms. 建立包含名為 Button2 之按鈕的表單。Create a form that contains a button named Button2. 將程式碼貼到表單中, 並將此方法與Click按鈕的事件產生關聯。Paste the code into the form and associate this method with the button's Click event.

void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   Bitmap^ bitmap1 = Bitmap::FromHicon( SystemIcons::Hand->Handle );
   Graphics^ formGraphics = this->CreateGraphics();
   GraphicsUnit units = GraphicsUnit::Point;
   RectangleF bmpRectangleF = bitmap1->GetBounds( units );
   Rectangle bmpRectangle = Rectangle::Round( bmpRectangleF );
   formGraphics->DrawRectangle( Pens::Blue, bmpRectangle );
   delete formGraphics;
}
private void Button2_Click(System.Object sender, System.EventArgs e)
{

    Bitmap bitmap1 = Bitmap.FromHicon(SystemIcons.Hand.Handle);
    Graphics formGraphics = this.CreateGraphics();
    GraphicsUnit units = GraphicsUnit.Point;

    RectangleF bmpRectangleF = bitmap1.GetBounds(ref units);
    Rectangle bmpRectangle = Rectangle.Round(bmpRectangleF);
    formGraphics.DrawRectangle(Pens.Blue, bmpRectangle);
    formGraphics.Dispose();
}
Private Sub Button2_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button2.Click

    Dim bitmap1 As Bitmap = Bitmap.FromHicon(SystemIcons.Hand.Handle)
    Dim formGraphics As Graphics = Me.CreateGraphics()
    Dim units As GraphicsUnit = GraphicsUnit.Point
    Dim bmpRectangleF As RectangleF = bitmap1.GetBounds(units)
    Dim bmpRectangle As Rectangle = Rectangle.Round(bmpRectangleF)
    formGraphics.DrawRectangle(Pens.Blue, bmpRectangle)
    formGraphics.Dispose()
End Sub

屬性

Application

取得 Icon 物件,其含有預設的應用程式圖示 (WIN32: IDI_APPLICATION)。Gets an Icon object that contains the default application icon (WIN32: IDI_APPLICATION).

Asterisk

取得 Icon 物件,其含有系統星號圖示 (WIN32: IDI_ASTERISK)。Gets an Icon object that contains the system asterisk icon (WIN32: IDI_ASTERISK).

Error

取得 Icon 物件,其含有系統錯誤圖示 (WIN32: IDI_ERROR)。Gets an Icon object that contains the system error icon (WIN32: IDI_ERROR).

Exclamation

取得 Icon 物件,含有系統驚嘆號圖示 (WIN32: IDI_EXCLAMATION)。Gets an Icon object that contains the system exclamation icon (WIN32: IDI_EXCLAMATION).

Hand

取得 Icon 物件,含有系統手掌圖示 (WIN32: IDI_HAND)。Gets an Icon object that contains the system hand icon (WIN32: IDI_HAND).

Information

取得 Icon 物件,含有系統資訊圖示 (WIN32: IDI_INFORMATION)。Gets an Icon object that contains the system information icon (WIN32: IDI_INFORMATION).

Question

取得 Icon 物件,含有系統問號圖示 (WIN32: IDI_QUESTION)。Gets an Icon object that contains the system question icon (WIN32: IDI_QUESTION).

Shield

取得含有盾牌圖示的 Icon 物件。Gets an Icon object that contains the shield icon.

Warning

取得 Icon 物件,其含有系統警告圖示 (WIN32: IDI_WARNING)。Gets an Icon object that contains the system warning icon (WIN32: IDI_WARNING).

WinLogo

取得 Icon 物件,含有 Windows 標誌圖示 (WIN32: IDI_WINLOGO)。Gets an Icon object that contains the Windows logo icon (WIN32: IDI_WINLOGO).

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於