ToolStripDropDownMenu.CreateDefaultItem(String, Image, EventHandler) Method

Definition

Crea un ToolStripMenuItem predeterminado con el texto, la imagen y el controlador de eventos especificados en un nuevo ToolStripDropDownMenu.Creates a default ToolStripMenuItem with the specified text, image, and event handler on a new ToolStripDropDownMenu.

protected public:
 override System::Windows::Forms::ToolStripItem ^ CreateDefaultItem(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick);
protected internal override System.Windows.Forms.ToolStripItem CreateDefaultItem (string text, System.Drawing.Image image, EventHandler onClick);
override this.CreateDefaultItem : string * System.Drawing.Image * EventHandler -> System.Windows.Forms.ToolStripItem
Protected Friend Overrides Function CreateDefaultItem (text As String, image As Image, onClick As EventHandler) As ToolStripItem

Parameters

text
String

Texto que se usará para el elemento ToolStripMenuItem.The text to use for the ToolStripMenuItem. Si el parámetro text es un guion (-), este método crea un ToolStripSeparator.If the text parameter is a hyphen (-), this method creates a ToolStripSeparator.

image
Image

Image que se va a mostrar en el elemento ToolStripMenuItem.The Image to display on the ToolStripMenuItem.

onClick
EventHandler

Un controlador de eventos que provoca el evento Click al hacer clic en ToolStripMenuItem.An event handler that raises the Click event when the ToolStripMenuItem is clicked.

Returns

ToolStripItem

ToolStripMenuItem o ToolStripSeparator si el parámetro text es un guion (-).A ToolStripMenuItem, or a ToolStripSeparator if the text parameter is a hyphen (-).

Remarks

Utilice el método CreateDefaultItem para agregar un ToolStripMenuItem con características utilizadas normalmente a un ToolStripDropDownMenu.Use the CreateDefaultItem method to add a ToolStripMenuItem with commonly used characteristics to a ToolStripDropDownMenu.

Applies to