FontFamily.Equals(Object) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belirtilen nesnenin bir FontFamily olup olmadığını ve ile FontFamilyaynı olup olmadığını gösterir.
public:
override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
public override bool Equals (object? obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean
Parametreler
- obj
- Object
Sınanacak nesne.
Döndürülenler
true
bir ise ve bu FontFamilyile aynıysaobj
; aksi takdirde , false
.FontFamily
Örnekler
Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve olay işleyicisinin Paint bir parametresi olan gerektirir.PaintEventArgse
Kod aşağıdaki eylemleri gerçekleştirir:
İki Font nesne oluşturur.
Eşdeğer olup olmadıklarını sınar.
Testin sonucunu ileti kutusunda görüntüler.
public:
void Equals_Example( PaintEventArgs^ /*e*/ )
{
// Create two FontFamily objects.
FontFamily^ firstFontFamily = gcnew FontFamily( "Arial" );
FontFamily^ secondFontFamily = gcnew FontFamily( "Times New Roman" );
// Check to see if the two font families are equivalent.
bool equalFonts = firstFontFamily->Equals( secondFontFamily );
// Display the result of the test in a message box.
MessageBox::Show( equalFonts.ToString() );
}
public void Equals_Example(PaintEventArgs e)
{
// Create two FontFamily objects.
FontFamily firstFontFamily = new FontFamily("Arial");
FontFamily secondFontFamily = new FontFamily("Times New Roman");
// Check to see if the two font families are equivalent.
bool equalFonts = firstFontFamily.Equals(secondFontFamily);
// Display the result of the test in a message box.
MessageBox.Show(equalFonts.ToString());
}
Public Sub Equals_Example(ByVal e As PaintEventArgs)
' Create two FontFamily objects.
Dim firstFontFamily As New FontFamily("Arial")
Dim secondFontFamily As New FontFamily("Times New Roman")
' Check to see if the two font families are equivalent.
Dim equalFonts As Boolean = _
firstFontFamily.Equals(secondFontFamily)
' Display the result of the test in a message box.
MessageBox.Show(equalFonts.ToString())
End Sub
Şunlara uygulanır
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin