SystemIcons クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
SystemIcons クラスの各プロパティは、システム全体のアイコンのIcon オブジェクトWindows。 このクラスは継承できません。
public ref class SystemIcons sealed
public sealed class SystemIcons
type SystemIcons = class
Public NotInheritable Class SystemIcons
- 継承
-
SystemIcons
例
次のコード例では、GraphicsUnit列挙型を使用してIcon ハンドルからビットマップを読み込む方法と、Round メソッドを使用してビットマップの四角形の境界を描画する方法を示します。
この例は、Windows フォームで使用するように設計されています。 Button2 という名前のボタンを含むフォームを作成します。 コードをフォームに貼り付け、このメソッドをボタンの Click イベントに関連付けます。
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
注釈
Note
.NET 6 以降のバージョンでは、この種類を含む System.Drawing.Common パッケージは、Windows オペレーティング システムでのみサポートされています。 クロスプラットフォーム アプリでこの種類を使用すると、コンパイル時の警告と実行時の例外が発生します。 詳細については、「System.Drawing.Common が Windows でしかサポートされない」を参照してください。
プロパティ
| 名前 | 説明 |
|---|---|
| Application |
既定のアプリケーション アイコン (WIN32: IDI_APPLICATION) を含む Icon オブジェクトを取得します。 |
| Asterisk |
システム アスタリスク アイコン (WIN32: IDI_ASTERISK) を含む Icon オブジェクトを取得します。 |
| Error |
システム エラー アイコン (WIN32: IDI_ERROR) を含む Icon オブジェクトを取得します。 |
| Exclamation |
システム感嘆符アイコン (WIN32: IDI_EXCLAMATION) を含む Icon オブジェクトを取得します。 |
| Hand |
システム ハンド アイコン (WIN32: IDI_HAND) を含む Icon オブジェクトを取得します。 |
| Information |
システム情報アイコン (WIN32: IDI_INFORMATION) を含む Icon オブジェクトを取得します。 |
| Question |
システム質問アイコン (WIN32: IDI_QUESTION) を含む Icon オブジェクトを取得します。 |
| Shield |
シールド アイコンを含む Icon オブジェクトを取得します。 |
| Warning |
システム警告アイコン (WIN32: IDI_WARNING) を含む Icon オブジェクトを取得します。 |
| WinLogo |
Windows ロゴ アイコン (WIN32: IDI_WINLOGO) を含むIcon オブジェクトを取得します。 |
メソッド
| 名前 | 説明 |
|---|---|
| Equals(Object) |
指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
| GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
| GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
| MemberwiseClone() |
現在の Objectの簡易コピーを作成します。 (継承元 Object) |
| ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |