Font.Style 속성

정의

Font의 스타일 정보를 가져옵니다.

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

속성 값

Font의 스타일 정보를 포함하는 FontStyle 열거형입니다.

특성

예제

다음 코드 예제에서는 단추의 속성을 열거형을 사용하여 새 굵은 글꼴로 FontStyle 설정하는 Font 방법을 보여 줍니다. 이 예제는 Windows Forms 사용하도록 설계되었습니다. 라는 Button1 단추가 포함된 폼을 Create 다음 코드를 붙여넣습니다. 메서드를 Button1_Click 단추의 Click 이벤트와 연결합니다.

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

적용 대상