ToolStripDropDownItem Costruttori

Definizione

Inizializza una nuova istanza della classe ToolStripDropDownItem.

Overload

Nome Descrizione
ToolStripDropDownItem()

Inizializza una nuova istanza della classe ToolStripDropDownItem.

ToolStripDropDownItem(String, Image, EventHandler)

Inizializza una nuova istanza della ToolStripDropDownItem classe con il testo visualizzato, l'immagine e l'azione specificati da eseguire quando si fa clic sul controllo a discesa.

ToolStripDropDownItem(String, Image, ToolStripItem[])

Inizializza una nuova istanza della ToolStripDropDownItem classe con il testo visualizzato, l'immagine e ToolStripItem la raccolta specificati contenuti nel controllo a discesa.

ToolStripDropDownItem(String, Image, EventHandler, String)

Inizializza una nuova istanza della ToolStripDropDownItem classe con il testo visualizzato, l'immagine, l'azione da eseguire quando si fa clic sul controllo a discesa e il nome del controllo.

Commenti

È necessario derivare un controllo a discesa dalla ToolStripDropDownItem classe per avere qualsiasi funzionalità a discesa per un ToolStripDropDownButtoncontrollo , ToolStripMenuItemo ToolStripSplitButton .

ToolStripDropDownItem()

Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs

Inizializza una nuova istanza della classe ToolStripDropDownItem.

protected:
 ToolStripDropDownItem();
protected ToolStripDropDownItem();
Protected Sub New ()

Esempio

Nell'esempio di codice seguente viene illustrato come creare e inizializzare ToolStripDropDownItem i controlli. Questo esempio di codice fa parte di un esempio più ampio fornito per la ToolStripDropDownItem classe .

// This utility method creates and initializes three 
// ToolStripDropDownItem controls and adds them 
// to the form's ToolStrip control.
private void InitializeToolStripDropDownItems()
{
    ToolStripDropDownButton b = new ToolStripDropDownButton("DropDownButton");
    b.DropDown = this.contextMenuStrip1;
    b.DropDownClosed += new EventHandler(toolStripDropDownItem_DropDownClosed);
    b.DropDownItemClicked += new ToolStripItemClickedEventHandler(toolStripDropDownItem_DropDownItemClicked);
    b.DropDownOpened += new EventHandler(toolStripDropDownItem_DropDownOpened);

    ToolStripMenuItem m = new ToolStripMenuItem("MenuItem");
    m.DropDown = this.contextMenuStrip1;
    m.DropDownClosed += new EventHandler(toolStripDropDownItem_DropDownClosed);
    m.DropDownItemClicked += new ToolStripItemClickedEventHandler(toolStripDropDownItem_DropDownItemClicked);
    m.DropDownOpened += new EventHandler(toolStripDropDownItem_DropDownOpened);

    ToolStripSplitButton sb = new ToolStripSplitButton("SplitButton");
    sb.DropDown = this.contextMenuStrip1;
    sb.DropDownClosed += new EventHandler(toolStripDropDownItem_DropDownClosed);
    sb.DropDownItemClicked += new ToolStripItemClickedEventHandler(toolStripDropDownItem_DropDownItemClicked);
    sb.DropDownOpened += new EventHandler(toolStripDropDownItem_DropDownOpened);

    this.toolStrip1.Items.AddRange(new ToolStripItem[] { b, m, sb });
}
' This utility method creates and initializes three 
' ToolStripDropDownItem controls and adds them 
' to the form's ToolStrip control.
Private Sub InitializeToolStripDropDownItems()
   Dim b As New ToolStripDropDownButton("DropDownButton")
   b.DropDown = Me.contextMenuStrip1
   AddHandler b.DropDownClosed, AddressOf toolStripDropDownItem_DropDownClosed
   AddHandler b.DropDownItemClicked, AddressOf toolStripDropDownItem_DropDownItemClicked
   AddHandler b.DropDownOpened, AddressOf toolStripDropDownItem_DropDownOpened
   
   Dim m As New ToolStripMenuItem("MenuItem")
   m.DropDown = Me.contextMenuStrip1
   AddHandler m.DropDownClosed, AddressOf toolStripDropDownItem_DropDownClosed
   AddHandler m.DropDownItemClicked, AddressOf toolStripDropDownItem_DropDownItemClicked
   AddHandler m.DropDownOpened, AddressOf toolStripDropDownItem_DropDownOpened
   
   Dim sb As New ToolStripSplitButton("SplitButton")
   sb.DropDown = Me.contextMenuStrip1
   AddHandler sb.DropDownClosed, AddressOf toolStripDropDownItem_DropDownClosed
   AddHandler sb.DropDownItemClicked, AddressOf toolStripDropDownItem_DropDownItemClicked
   AddHandler sb.DropDownOpened, AddressOf toolStripDropDownItem_DropDownOpened
   
   Me.toolStrip1.Items.AddRange(New ToolStripItem() {b, m, sb})
End Sub

Commenti

È necessario derivare un controllo a discesa dalla ToolStripDropDownItem classe per avere qualsiasi funzionalità a discesa per un ToolStripDropDownButtoncontrollo , ToolStripMenuItemo ToolStripSplitButton .

Si applica a

ToolStripDropDownItem(String, Image, EventHandler)

Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs

Inizializza una nuova istanza della ToolStripDropDownItem classe con il testo visualizzato, l'immagine e l'azione specificati da eseguire quando si fa clic sul controllo a discesa.

protected:
 ToolStripDropDownItem(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick);
protected ToolStripDropDownItem(string text, System.Drawing.Image image, EventHandler onClick);
protected ToolStripDropDownItem(string? text, System.Drawing.Image? image, EventHandler? onClick);
new System.Windows.Forms.ToolStripDropDownItem : string * System.Drawing.Image * EventHandler -> System.Windows.Forms.ToolStripDropDownItem
Protected Sub New (text As String, image As Image, onClick As EventHandler)

Parametri

text
String

Testo visualizzato del controllo a discesa.

image
Image

Oggetto Image da visualizzare nel controllo .

onClick
EventHandler

Azione da eseguire quando si fa clic sul controllo a discesa.

Commenti

È necessario derivare un controllo a discesa dalla ToolStripDropDownItem classe per avere qualsiasi funzionalità a discesa per un ToolStripDropDownButtoncontrollo , ToolStripMenuItemo ToolStripSplitButton .

Si applica a

ToolStripDropDownItem(String, Image, ToolStripItem[])

Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs

Inizializza una nuova istanza della ToolStripDropDownItem classe con il testo visualizzato, l'immagine e ToolStripItem la raccolta specificati contenuti nel controllo a discesa.

protected:
 ToolStripDropDownItem(System::String ^ text, System::Drawing::Image ^ image, ... cli::array <System::Windows::Forms::ToolStripItem ^> ^ dropDownItems);
protected ToolStripDropDownItem(string text, System.Drawing.Image image, params System.Windows.Forms.ToolStripItem[] dropDownItems);
protected ToolStripDropDownItem(string? text, System.Drawing.Image? image, params System.Windows.Forms.ToolStripItem[]? dropDownItems);
new System.Windows.Forms.ToolStripDropDownItem : string * System.Drawing.Image * System.Windows.Forms.ToolStripItem[] -> System.Windows.Forms.ToolStripDropDownItem
Protected Sub New (text As String, image As Image, ParamArray dropDownItems As ToolStripItem())

Parametri

text
String

Testo visualizzato del controllo a discesa.

image
Image

Oggetto Image da visualizzare nel controllo .

dropDownItems
ToolStripItem[]

Raccolta ToolStripItem contenuta dal controllo a discesa.

Commenti

È necessario derivare un controllo a discesa dalla ToolStripDropDownItem classe per avere qualsiasi funzionalità a discesa per un ToolStripDropDownButtoncontrollo , ToolStripMenuItemo ToolStripSplitButton .

Si applica a

ToolStripDropDownItem(String, Image, EventHandler, String)

Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs
Origine:
ToolStripDropDownItem.cs

Inizializza una nuova istanza della ToolStripDropDownItem classe con il testo visualizzato, l'immagine, l'azione da eseguire quando si fa clic sul controllo a discesa e il nome del controllo.

protected:
 ToolStripDropDownItem(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick, System::String ^ name);
protected ToolStripDropDownItem(string text, System.Drawing.Image image, EventHandler onClick, string name);
protected ToolStripDropDownItem(string? text, System.Drawing.Image? image, EventHandler? onClick, string? name);
new System.Windows.Forms.ToolStripDropDownItem : string * System.Drawing.Image * EventHandler * string -> System.Windows.Forms.ToolStripDropDownItem
Protected Sub New (text As String, image As Image, onClick As EventHandler, name As String)

Parametri

text
String

Testo visualizzato del controllo a discesa.

image
Image

Oggetto Image da visualizzare nel controllo .

onClick
EventHandler

Azione da eseguire quando si fa clic sul controllo a discesa.

name
String

Nome del controllo.

Si applica a