Font.GetHashCode Metodo
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene il codice hash per questo Font.
public:
override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer
Codice hash per questo Font.
L'esempio di codice seguente è progettato per l'uso con Windows Form e richiede PaintEventArgse
, che è un parametro del gestore eventi Paint. Il codice esegue le azioni seguenti:
Crea un Font.
Ottiene il codice hash per il tipo di carattere.
Visualizza una finestra di messaggio con il valore del codice hash.
public:
void GetHashCode_Example( PaintEventArgs^ /*e*/ )
{
// Create a Font object.
System::Drawing::Font^ myFont = gcnew System::Drawing::Font( "Arial",16 );
// Get the hash code for myFont.
int hashCode = myFont->GetHashCode();
// Display the hash code in a message box.
MessageBox::Show( hashCode.ToString() );
}
public void GetHashCode_Example(PaintEventArgs e)
{
// Create a Font object.
Font myFont = new Font("Arial", 16);
// Get the hash code for myFont.
int hashCode = myFont.GetHashCode();
// Display the hash code in a message box.
MessageBox.Show(hashCode.ToString());
}
Public Sub GetHashCode_Example(ByVal e As PaintEventArgs)
' Create a Font object.
Dim myFont As New Font("Arial", 16)
' Get the hash code for myFont.
Dim hashCode As Integer = myFont.GetHashCode()
' Display the hash code in a message box.
MessageBox.Show(hashCode.ToString())
End Sub
Prodotto | Versioni |
---|---|
.NET | 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: