Font.Style Özellik

Tanım

Bunun Fontstil bilgilerini alır.

public:
 property System::Drawing::FontStyle Style { System::Drawing::FontStyle get(); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.FontStyle Style { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Style : System.Drawing.FontStyle
Public ReadOnly Property Style As FontStyle

Özellik Değeri

FontStyle Bu Fontiçin stil bilgilerini içeren bir numaralandırma.

Öznitelikler

Örnekler

Aşağıdaki kod örneği, sabit listesi kullanılarak bir düğmenin özelliğinin yeni bir kalın yazı tipine FontStyle nasıl ayarlandığını Font gösterir. Bu örnek, Windows Forms ile kullanılacak şekilde tasarlanmıştır. adlı Button1 düğmeyi içeren bir form İçerik Oluşturucu ve aşağıdaki kodu bu forma yapıştırın. Button1_Click yöntemini düğmenin Click olayıyla ilişkilendirin.

private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      Button1->Font = gcnew System::Drawing::Font( FontFamily::GenericSansSerif,12.0F,FontStyle::Bold );
   }
private void Button1_Click(System.Object sender, System.EventArgs e)
{
    if (Button1.Font.Style != FontStyle.Bold)
            Button1.Font = new Font(FontFamily.GenericSansSerif,
            12.0F, FontStyle.Bold);
}
 Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    If Not Button1.Font.Style = FontStyle.Bold Then
        Button1.Font = New Font(FontFamily.GenericSansSerif, _
            12.0F, FontStyle.Bold)
    End If
End Sub

Şunlara uygulanır