FontStyle 열거형

정의

텍스트에 적용된 스타일 정보를 지정합니다.

이 열거형은 멤버 값의 비트 조합을 지원합니다.

public enum class FontStyle
[System.Flags]
public enum FontStyle
[<System.Flags>]
type FontStyle = 
Public Enum FontStyle
상속
FontStyle
특성

필드

Bold 1

굵은 텍스트

Italic 2

기울임꼴 텍스트

Regular 0

일반 텍스트

Strikeout 8

중간에 줄이 있는 텍스트

Underline 4

밑줄이 그어진 텍스트

예제

다음 코드 예제에서는 단추의 속성을 열거형을 사용 하 여 새 굵은 스타일 글꼴로 설정 Font 하는 FontStyle 방법을 보여 줍니다. 이 예제는 Windows Forms 사용하도록 설계되었습니다. Button1이라는 단추가 포함된 양식을 만들고 다음 코드를 붙여넣습니다. 메서드를 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

적용 대상