Font.Bold Propriedade

Definição

Obtém um valor que indica se este Font está em negrito.Gets a value that indicates whether this Font is bold.

public:
 property bool Bold { bool get(); };
public bool Bold { get; }
member this.Bold : bool
Public ReadOnly Property Bold As Boolean

Valor da propriedade

Boolean

true se este Font estiver em negrito; caso contrário, false.true if this Font is bold; otherwise, false.

Exemplos

O exemplo de código a seguir demonstra o Inequality operador, o Font Construtor e a Bold propriedade.The following code example demonstrates the Inequality operator, the Font constructor, and the Bold property. Este exemplo foi projetado para ser usado com um formulário do Windows que contém um botão chamado Button2 .This example is designed to be used with a Windows Form that contains a button named Button2. Cole o código a seguir em seu formulário e associe o Button2_Click método ao evento do botão Click .Paste the following code into your form and associate the Button2_Click method with the button's Click event.

void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   if ( this->BackColor != SystemColors::ControlDark )
   {
      this->BackColor = SystemColors::ControlDark;
   }

   if (  !(this->Font->Bold) )
   {
      this->Font = gcnew System::Drawing::Font( this->Font,FontStyle::Bold );
   }
}
private void Button2_Click(System.Object sender, System.EventArgs e)
{

    if (this.BackColor != SystemColors.ControlDark)
    {
        this.BackColor = SystemColors.ControlDark;
    }
    if (!(this.Font.Bold))
    {
        this.Font = new Font(this.Font, FontStyle.Bold);
    }
}
Private Sub Button2_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button2.Click

    If (Color.op_Inequality(Me.BackColor, SystemColors.ControlDark)) Then
        Me.BackColor = SystemColors.ControlDark
    End If
    If Not (Me.Font.Bold) Then
        Me.Font = New Font(Me.Font, FontStyle.Bold)
    End If
End Sub

Aplica-se a