ToolStripDropDownButton ToolStripDropDownButton ToolStripDropDownButton ToolStripDropDownButton Constructors

Definición

Sobrecargas

ToolStripDropDownButton() ToolStripDropDownButton() ToolStripDropDownButton()

Inicializa una nueva instancia de la clase ToolStripDropDownButton.Initializes a new instance of the ToolStripDropDownButton class.

ToolStripDropDownButton(Image) ToolStripDropDownButton(Image) ToolStripDropDownButton(Image)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra la imagen especificada.Initializes a new instance of the ToolStripDropDownButton class that displays the specified image.

ToolStripDropDownButton(String) ToolStripDropDownButton(String) ToolStripDropDownButton(String) ToolStripDropDownButton(String)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra el texto especificado.Initializes a new instance of the ToolStripDropDownButton class that displays the specified text.

ToolStripDropDownButton(String, Image) ToolStripDropDownButton(String, Image) ToolStripDropDownButton(String, Image)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra la imagen y el texto especificados.Initializes a new instance of the ToolStripDropDownButton class that displays the specified text and image.

ToolStripDropDownButton(String, Image, EventHandler) ToolStripDropDownButton(String, Image, EventHandler) ToolStripDropDownButton(String, Image, EventHandler)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra la imagen y el texto especificados, y que provoca el evento Click.Initializes a new instance of the ToolStripDropDownButton class that displays the specified text and image and raises the Click event.

ToolStripDropDownButton(String, Image, ToolStripItem[]) ToolStripDropDownButton(String, Image, ToolStripItem[]) ToolStripDropDownButton(String, Image, ToolStripItem[])

Inicializa una nueva instancia de la clase ToolStripDropDownButton.Initializes a new instance of the ToolStripDropDownButton class.

ToolStripDropDownButton(String, Image, EventHandler, String) ToolStripDropDownButton(String, Image, EventHandler, String) ToolStripDropDownButton(String, Image, EventHandler, String)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que tiene el nombre especificado, muestra la imagen y el texto especificados, y provoca el evento Click.Initializes a new instance of the ToolStripDropDownButton class that has the specified name, displays the specified text and image, and raises the Click event.

ToolStripDropDownButton() ToolStripDropDownButton() ToolStripDropDownButton()

Inicializa una nueva instancia de la clase ToolStripDropDownButton.Initializes a new instance of the ToolStripDropDownButton class.

public:
 ToolStripDropDownButton();
public ToolStripDropDownButton ();
Public Sub New ()

Ejemplos

En el ejemplo de código siguiente se crea e ToolStripDropDownButton Inicializa un control.The following code example creates and initializes a ToolStripDropDownButton control.

// Declare the drop-down button and the items it will contain.
ToolStripDropDownButton^ dropDownButton1;
ToolStripDropDown^ dropDown;
ToolStripButton^ buttonRed;
ToolStripButton^ buttonBlue;
ToolStripButton^ buttonYellow;

void InitializeDropDownButton()
{
    dropDownButton1 = gcnew ToolStripDropDownButton;
    dropDown = gcnew ToolStripDropDown;
    dropDownButton1->Text = "A";

    // Set the drop-down on the DropDownButton.
    dropDownButton1->DropDown = dropDown;

    // Declare three buttons, set their forecolor and text, 
    // and add the buttons to the drop-down.
    buttonRed = gcnew ToolStripButton;
    buttonRed->ForeColor = Color::Red;
    buttonRed->Text = "A";
    buttonBlue = gcnew ToolStripButton;
    buttonBlue->ForeColor = Color::Blue;
    buttonBlue->Text = "A";
    buttonYellow = gcnew ToolStripButton;
    buttonYellow->ForeColor = Color::Yellow;
    buttonYellow->Text = "A";
    buttonBlue->Click += gcnew EventHandler(this, 
        &Form1::colorButtonsClick);
    buttonRed->Click += gcnew EventHandler(this, 
        &Form1::colorButtonsClick);
    buttonYellow->Click += gcnew EventHandler(this, 
        &Form1::colorButtonsClick);
    array<ToolStripItem^>^ ToolStrips = 
        {buttonRed,buttonBlue,buttonYellow};
    dropDown->Items->AddRange(ToolStrips);
    toolStrip1->Items->Add(dropDownButton1);
}


// Handle the buttons' click event by setting the forecolor 
// of the form to the forecolor of the button that is clicked.
void colorButtonsClick(Object^ sender, EventArgs^ e)
{
    ToolStripButton^ senderButton = (ToolStripButton^) sender;
    this->ForeColor = senderButton->ForeColor;
}


//  internal:

// Declare the drop-down button and the items it will contain.
internal ToolStripDropDownButton dropDownButton1;
internal ToolStripDropDown dropDown;
internal ToolStripButton buttonRed;
internal ToolStripButton buttonBlue;
internal ToolStripButton buttonYellow;


private void InitializeDropDownButton()
{
	dropDownButton1 = new ToolStripDropDownButton();
	dropDown = new ToolStripDropDown();
	dropDownButton1.Text = "A";

	// Set the drop-down on the ToolStripDropDownButton.
	dropDownButton1.DropDown = dropDown;

          // Set the drop-down direction.
          dropDownButton1.DropDownDirection = ToolStripDropDownDirection.Left;

          // Do not show a drop-down arrow.
          dropDownButton1.ShowDropDownArrow = false;

	// Declare three buttons, set their foreground color and text, 
	// and add the buttons to the drop-down.
	buttonRed = new ToolStripButton();
	buttonRed.ForeColor = Color.Red;
	buttonRed.Text = "A";

	buttonBlue = new ToolStripButton();
	buttonBlue.ForeColor = Color.Blue;
	buttonBlue.Text = "A";

	buttonYellow = new ToolStripButton();
	buttonYellow.ForeColor = Color.Yellow;
	buttonYellow.Text = "A";
	
	buttonBlue.Click += new EventHandler(colorButtonsClick);
	buttonRed.Click += new EventHandler(colorButtonsClick);
	buttonYellow.Click += new EventHandler(colorButtonsClick);

	dropDown.Items.AddRange(new ToolStripItem[] 
		{ buttonRed, buttonBlue, buttonYellow });
	toolStrip1.Items.Add(dropDownButton1);
}


// Handle the buttons' click event by setting the foreground color of the
// form to the foreground color of the button that is clicked.
private void colorButtonsClick(object sender, EventArgs e)
{
	ToolStripButton senderButton = (ToolStripButton)sender;
	this.ForeColor = senderButton.ForeColor;
}
' Declare the drop-down button and the items it will contain.
Friend WithEvents dropDownButton1 As ToolStripDropDownButton
Friend WithEvents dropDown As ToolStripDropDown
Friend WithEvents buttonRed As ToolStripButton
Friend WithEvents buttonBlue As ToolStripButton
Friend WithEvents buttonYellow As ToolStripButton

Private Sub InitializeDropDownButton() 
    dropDownButton1 = New ToolStripDropDownButton()
    dropDown = New ToolStripDropDown()
    dropDownButton1.Text = "A"
    
    ' Set the drop-down on the ToolStripDropDownButton.
    dropDownButton1.DropDown = dropDown

    ' Set the drop-down direction.
    dropDownButton1.DropDownDirection = ToolStripDropDownDirection.Left

    ' Do not show a drop-down arrow.
    dropDownButton1.ShowDropDownArrow = False

    ' Declare three buttons, set their foreground color and text, 
    ' and add the buttons to the drop-down.
    buttonRed = New ToolStripButton()
    buttonRed.ForeColor = Color.Red
    buttonRed.Text = "A"
    
    buttonBlue = New ToolStripButton()
    buttonBlue.ForeColor = Color.Blue
    buttonBlue.Text = "A"
    
    buttonYellow = New ToolStripButton()
    buttonYellow.ForeColor = Color.Yellow
    buttonYellow.Text = "A"
    
    dropDown.Items.AddRange(New ToolStripItem() {buttonRed, buttonBlue, buttonYellow})
    toolStrip1.Items.Add(dropDownButton1)
End Sub

' Handle the buttons' click event by setting the foreground color of the
' form to the foreground color of the button that is clicked.
Public Sub colorButtonsClick(ByVal sender As [Object], ByVal e As EventArgs) _
    Handles buttonRed.Click, buttonBlue.Click, buttonYellow.Click
    Dim senderButton As ToolStripButton = CType(sender, ToolStripButton)
    Me.ForeColor = senderButton.ForeColor

End Sub

ToolStripDropDownButton(Image) ToolStripDropDownButton(Image) ToolStripDropDownButton(Image)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra la imagen especificada.Initializes a new instance of the ToolStripDropDownButton class that displays the specified image.

public:
 ToolStripDropDownButton(System::Drawing::Image ^ image);
public ToolStripDropDownButton (System.Drawing.Image image);
new System.Windows.Forms.ToolStripDropDownButton : System.Drawing.Image -> System.Windows.Forms.ToolStripDropDownButton

Parámetros

image
Image Image Image Image

Objeto Image que se va a mostrar en el control ToolStripDropDownButton.An Image to be displayed on the ToolStripDropDownButton.

ToolStripDropDownButton(String) ToolStripDropDownButton(String) ToolStripDropDownButton(String) ToolStripDropDownButton(String)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra el texto especificado.Initializes a new instance of the ToolStripDropDownButton class that displays the specified text.

public:
 ToolStripDropDownButton(System::String ^ text);
public ToolStripDropDownButton (string text);
new System.Windows.Forms.ToolStripDropDownButton : string -> System.Windows.Forms.ToolStripDropDownButton
Public Sub New (text As String)

Parámetros

text
String String String String

El texto que se va a mostrar en el control ToolStripDropDownButton.The text to be displayed on the ToolStripDropDownButton.

ToolStripDropDownButton(String, Image) ToolStripDropDownButton(String, Image) ToolStripDropDownButton(String, Image)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra la imagen y el texto especificados.Initializes a new instance of the ToolStripDropDownButton class that displays the specified text and image.

public:
 ToolStripDropDownButton(System::String ^ text, System::Drawing::Image ^ image);
public ToolStripDropDownButton (string text, System.Drawing.Image image);
new System.Windows.Forms.ToolStripDropDownButton : string * System.Drawing.Image -> System.Windows.Forms.ToolStripDropDownButton

Parámetros

text
String String String String

El texto que se va a mostrar en el control ToolStripDropDownButton.The text to be displayed on the ToolStripDropDownButton.

image
Image Image Image Image

Objeto Image que se va a mostrar en el control ToolStripDropDownButton.An Image to be displayed on the ToolStripDropDownButton.

ToolStripDropDownButton(String, Image, EventHandler) ToolStripDropDownButton(String, Image, EventHandler) ToolStripDropDownButton(String, Image, EventHandler)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que muestra la imagen y el texto especificados, y que provoca el evento Click.Initializes a new instance of the ToolStripDropDownButton class that displays the specified text and image and raises the Click event.

public:
 ToolStripDropDownButton(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick);
public ToolStripDropDownButton (string text, System.Drawing.Image image, EventHandler onClick);
new System.Windows.Forms.ToolStripDropDownButton : string * System.Drawing.Image * EventHandler -> System.Windows.Forms.ToolStripDropDownButton

Parámetros

text
String String String String

El texto que se va a mostrar en el control ToolStripDropDownButton.The text to be displayed on the ToolStripDropDownButton.

image
Image Image Image Image

Objeto Image que se va a mostrar en el control ToolStripDropDownButton.An Image to be displayed on the ToolStripDropDownButton.

onClick
EventHandler EventHandler EventHandler EventHandler

Controlador de eventos para el evento Click.The event handler for the Click event.

ToolStripDropDownButton(String, Image, ToolStripItem[]) ToolStripDropDownButton(String, Image, ToolStripItem[]) ToolStripDropDownButton(String, Image, ToolStripItem[])

Inicializa una nueva instancia de la clase ToolStripDropDownButton.Initializes a new instance of the ToolStripDropDownButton class.

public:
 ToolStripDropDownButton(System::String ^ text, System::Drawing::Image ^ image, ... cli::array <System::Windows::Forms::ToolStripItem ^> ^ dropDownItems);
public ToolStripDropDownButton (string text, System.Drawing.Image image, params System.Windows.Forms.ToolStripItem[] dropDownItems);
new System.Windows.Forms.ToolStripDropDownButton : string * System.Drawing.Image * System.Windows.Forms.ToolStripItem[] -> System.Windows.Forms.ToolStripDropDownButton

Parámetros

text
String String String String

El texto que se va a mostrar en el control ToolStripDropDownButton.The text to be displayed on the ToolStripDropDownButton.

image
Image Image Image Image

Objeto Image que se va a mostrar en el control ToolStripDropDownButton.An Image to be displayed on the ToolStripDropDownButton.

dropDownItems
ToolStripItem[]

Matriz de tipo ToolStripItem que contiene los elementos de ToolStripDropDownButton.An array of type ToolStripItem containing the items of the ToolStripDropDownButton.

ToolStripDropDownButton(String, Image, EventHandler, String) ToolStripDropDownButton(String, Image, EventHandler, String) ToolStripDropDownButton(String, Image, EventHandler, String)

Inicializa una nueva instancia de la clase ToolStripDropDownButton que tiene el nombre especificado, muestra la imagen y el texto especificados, y provoca el evento Click.Initializes a new instance of the ToolStripDropDownButton class that has the specified name, displays the specified text and image, and raises the Click event.

public:
 ToolStripDropDownButton(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick, System::String ^ name);
public ToolStripDropDownButton (string text, System.Drawing.Image image, EventHandler onClick, string name);
new System.Windows.Forms.ToolStripDropDownButton : string * System.Drawing.Image * EventHandler * string -> System.Windows.Forms.ToolStripDropDownButton

Parámetros

text
String String String String

El texto que se va a mostrar en el control ToolStripDropDownButton.The text to be displayed on the ToolStripDropDownButton.

image
Image Image Image Image

Objeto Image que se va a mostrar en el control ToolStripDropDownButton.An Image to be displayed on the ToolStripDropDownButton.

onClick
EventHandler EventHandler EventHandler EventHandler

Controlador de eventos para el evento Click.The event handler for the Click event.

name
String String String String

Nombre del objeto ToolStripDropDownButton.The name of the ToolStripDropDownButton.

Se aplica a