ToolStrip.CreateDefaultItem(String, Image, EventHandler) ToolStrip.CreateDefaultItem(String, Image, EventHandler) ToolStrip.CreateDefaultItem(String, Image, EventHandler) Method

定義

使用指定的文字、影像和事件處理常式,在新的 ToolStrip 執行個體上建立預設的 ToolStripItemCreates a default ToolStripItem with the specified text, image, and event handler on a new ToolStrip instance.

protected public:
 virtual System::Windows::Forms::ToolStripItem ^ CreateDefaultItem(System::String ^ text, System::Drawing::Image ^ image, EventHandler ^ onClick);
protected internal virtual System.Windows.Forms.ToolStripItem CreateDefaultItem (string text, System.Drawing.Image image, EventHandler onClick);
abstract member CreateDefaultItem : string * System.Drawing.Image * EventHandler -> System.Windows.Forms.ToolStripItem
override this.CreateDefaultItem : string * System.Drawing.Image * EventHandler -> System.Windows.Forms.ToolStripItem

參數

text
String String String

用於 ToolStripItem 的文字。The text to use for the ToolStripItem. 如果 text 參數為連字號 (-),則這個方法會建立 ToolStripSeparatorIf the text parameter is a hyphen (-), this method creates a ToolStripSeparator.

image
Image Image Image

要顯示在 ToolStripItem 上的 ImageThe Image to display on the ToolStripItem.

onClick
EventHandler EventHandler EventHandler

按一下 ToolStripItem 時引發 Click 事件的事件處理常式。An event handler that raises the Click event when the ToolStripItem is clicked.

傳回

適用於