This documentation is archived and is not being maintained.

ToolStripDropDownMenu.CreateDefaultItem Method

Note: This method is new in the .NET Framework version 2.0.

Creates a default ToolStripMenuItem with the specified text, image, and event handler on a new ToolStripDropDownMenu.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

protected internal override ToolStripItem CreateDefaultItem (
	string text,
	Image image,
	EventHandler onClick
protected ToolStripItem CreateDefaultItem (
	String text, 
	Image image, 
	EventHandler onClick
protected internal override function CreateDefaultItem (
	text : String, 
	image : Image, 
	onClick : EventHandler
) : ToolStripItem



The text to use for the ToolStripMenuItem. If the text parameter is a hyphen (-), this method creates a ToolStripSeparator.


The Image to display on the ToolStripMenuItem.


An event handler that raises the Click event when the ToolStripMenuItem is clicked.

Return Value

A ToolStripMenuItem, or a ToolStripSeparator if the text parameter is a hyphen (-).

Use the CreateDefaultItem method to add a ToolStripMenuItem with commonly used characteristics to a ToolStripDropDownMenu.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0