FontDialog.ShowColor Propiedad

Definición

Obtiene o establece un valor que indica si el cuadro de diálogo muestra la opción de color.

public:
 property bool ShowColor { bool get(); void set(bool value); };
public bool ShowColor { get; set; }
member this.ShowColor : bool with get, set
Public Property ShowColor As Boolean

Valor de propiedad

Boolean

Es true si el cuadro de diálogo muestra la opción de color; en caso contrario, es false. El valor predeterminado es false.

Ejemplos

En el ejemplo de código siguiente se usa ShowDialog para mostrar un FontDialog. Este código requiere que ya se haya creado un Form elemento con un TextBox botón y colocado en él. También requiere que se haya creado .fontDialog1 Font contiene la información de tamaño, pero no la información de color.

private:
   void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      fontDialog1->ShowColor = true;

      fontDialog1->Font = textBox1->Font;
      fontDialog1->Color = textBox1->ForeColor;

      if ( fontDialog1->ShowDialog() != ::DialogResult::Cancel )
      {
         textBox1->Font = fontDialog1->Font;
         textBox1->ForeColor = fontDialog1->Color;
      }
   }
private void button1_Click(object sender, System.EventArgs e)
 {
    fontDialog1.ShowColor = true;

    fontDialog1.Font = textBox1.Font;
    fontDialog1.Color = textBox1.ForeColor;

    if(fontDialog1.ShowDialog() != DialogResult.Cancel )
    {
       textBox1.Font = fontDialog1.Font ;
       textBox1.ForeColor = fontDialog1.Color;
    }
 }
Private Sub button1_Click(sender As Object, e As System.EventArgs)
    fontDialog1.ShowColor = True

    fontDialog1.Font = textBox1.Font
    fontDialog1.Color = textBox1.ForeColor

    If fontDialog1.ShowDialog() <> DialogResult.Cancel Then
        textBox1.Font = fontDialog1.Font
        textBox1.ForeColor = fontDialog1.Color
    End If
End Sub

Se aplica a

Consulte también