Font.GetHashCode 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 Font대한 해시 코드를 가져옵니다.
public:
override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer
반환
이 Font대한 해시 코드입니다.
예제
다음 코드 예제는 Windows Forms에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse
필요합니다. 코드는 다음 작업을 수행합니다.
Font만듭니다.
해당 글꼴의 해시 코드를 가져옵니다.
해시 코드 값이 있는 메시지 상자를 표시합니다.
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