SystemIcons Classe

Definizione

Ogni proprietà della classe è un oggetto />

public ref class SystemIcons sealed
public sealed class SystemIcons
type SystemIcons = class
Public NotInheritable Class SystemIcons
Ereditarietà
SystemIcons

Esempio

Nell'esempio di codice seguente viene illustrato come caricare una bitmap da un Icon handle, usando l'enumerazione GraphicsUnit e l'uso del metodo per disegnare Round i limiti rettangoli di una bitmap.

Questo esempio è progettato per essere usato con Windows Form. Creare un modulo contenente un pulsante denominato Button2. Incollare il codice nel form e associare questo metodo all'evento del Click pulsante.

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

Commenti

Annotazioni

In .NET 6 e versioni successive il pacchetto System.Drawing.Common, che include questo tipo, è supportato solo nei sistemi operativi Windows. L'uso di questo tipo nelle app multipiattaforma causa avvisi in fase di compilazione ed eccezioni in fase di esecuzione. Per altre informazioni, vedere System.Drawing.Common supportato solo in Windows.

Proprietà

Nome Descrizione
Application

Ottiene un Icon oggetto contenente l'icona dell'applicazione predefinita (WIN32: IDI_APPLICATION).

Asterisk

Ottiene un Icon oggetto contenente l'icona dell'asterisco di sistema (WIN32: IDI_ASTERISK).

Error

Ottiene un Icon oggetto contenente l'icona di errore di sistema (WIN32: IDI_ERROR).

Exclamation

Ottiene un Icon oggetto contenente l'icona esclamativo di sistema (WIN32: IDI_EXCLAMATION).

Hand

Ottiene un Icon oggetto contenente l'icona della mano di sistema (WIN32: IDI_HAND).

Information

Ottiene un Icon oggetto contenente l'icona delle informazioni di sistema (WIN32: IDI_INFORMATION).

Question

Ottiene un Icon oggetto contenente l'icona della domanda di sistema (WIN32: IDI_QUESTION).

Shield

Ottiene un Icon oggetto contenente l'icona dello scudo.

Warning

Ottiene un Icon oggetto contenente l'icona di avviso di sistema (WIN32: IDI_WARNING).

WinLogo

Ottiene un oggetto Icon contenente l'icona del logo Windows (WIN32: IDI_WINLOGO).

Metodi

Nome Descrizione
Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a

Vedi anche