Exportar (0) Imprimir
Expandir todo

ToolStripDropDown.DefaultDropDownDirection (Propiedad)

Obtiene o establece la dirección en la que se muestra el control ToolStripDropDown con relación a ToolStrip.

Espacio de nombres: System.Windows.Forms
Ensamblado: System.Windows.Forms (en system.windows.forms.dll)

public override ToolStripDropDownDirection DefaultDropDownDirection { get; set; }
/** @property */
public ToolStripDropDownDirection get_DefaultDropDownDirection ()

/** @property */
public void set_DefaultDropDownDirection (ToolStripDropDownDirection value)

public override function get DefaultDropDownDirection () : ToolStripDropDownDirection

public override function set DefaultDropDownDirection (value : ToolStripDropDownDirection)

No aplicable.

Valor de propiedad

Uno de los valores de ToolStripDropDownDirection.

En el siguiente ejemplo de código se muestra cómo asignar la propiedad DefaultDropDownDirection especificada mediante una configuración de botón de opción.

// The following methods handle the CheckChanged event 
// for all the radio buttons. Each method calls a utility
// method to set the ToolStripDropDownDirection appropriately.

private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.AboveLeft);
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.AboveRight);
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.BelowLeft);
}

private void radioButton4_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.BelowRight);
}

private void radioButton5_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.Default);
}

private void radioButton6_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.Left);
}

private void radioButton7_CheckedChanged(object sender, EventArgs e)
{
    this.HandleRadioButton(sender, ToolStripDropDownDirection.Right);
}

// This utility method sets the DefaultDropDownDirection property.
private void HandleRadioButton(object sender, ToolStripDropDownDirection direction)
{
    RadioButton rb = sender as RadioButton;

    if (rb != null)
    {
        if (rb.Checked)
        {
            this.dropDownDirection = direction;
            this.contextMenuStrip1.DefaultDropDownDirection = direction;
        }
    }
}

Windows 98, Windows 2000 Service Pack 4, Windows CE, Windows Millennium, Windows Mobile para Pocket PC, Windows Mobile para Smartphone, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0, 2.0
Mostrar:
© 2014 Microsoft