This documentation is archived and is not being maintained.

MenuItemStyle::ItemSpacing Property

Gets or sets the amount of vertical spacing between the menu item to which the MenuItemStyle object is applied and its adjacent menu items.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property Unit ItemSpacing {
	Unit get ();
	void set (Unit value);
}

Property Value

Type: System.Web.UI.WebControls::Unit
The amount of vertical spacing (in pixels) between the menu item to which the MenuItemStyle object is applied and its adjacent menu items. The default is 0.

Use the ItemSpacing property to control the amount of vertical spacing between a menu item to which the MenuItemStyle object is applied and its adjacent menu items at the same level. This space is inserted between the upper edge of the current menu item and the lower edge of the previous menu item, as well as between the lower edge of the current menu item and upper edge of the next menu item.

NoteNote:

The upper space is not rendered for the first menu item in the Menu control.

The following code example demonstrates how to use the ItemSpacing property to separate a menu item from its adjacent menu items by 5 pixels.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: