ComponentOne WebMenus and WebBars for ASP.NET: Defining the GroupStyle and ItemStyle Classes > Common GroupStyle and ItemStyle Properties > BorderWidth Property

BorderWidth Property

The BorderWidth property gets or sets the border width of the Web server control.

GroupStyle.BorderWidth property

The following code shows how to apply the BorderWidth property to the GroupStyle object of the C1WebTopicBar control. The BorderWidth property can be set in different unit types such as pixels, percentage, and points. This example sets the border width size to 2 pixels.

•      Visual Basic

topicbar.GroupStyle.BorderWidth = Unit.Pixel(2)

•      C#

topicbar.GroupStyle.BorderWidth = Unit.Pixel(2);

ItemStyle.BorderWidth property

The ItemStyle.BorderWidth property gets or sets the border width of the items in the Web server control.

The following code shows how to apply the BorderWidth property to the ItemStyle object of the C1WebTopicBar control. This example sets the border width size to 5 pixels and the border color to antique white.

•      Visual Basic

topicbar.ItemStyle.BorderWidth = Unit.Pixel(5)

•      C#

topicbar.ItemStyle.BorderWidth = Unit.Pixel(5);

This example demonstrates how to apply the BorderWidth to the second item of  the second group.

Note: The code below is applicable for the flat controls: C1WebTopicBar, C1WebToolBar, and the C1WebTabStrip. The mechanism for specifying a specific item index is different for the tree type controls: C1WebTreeView and C1WebMenu.

•      Visual Basic

'set the border width for the second item of the second group

CType(topicbar.Groups(1).Items(1), C1WebLinkItem).ItemStyle.BorderWidth = Unit.Pixel(5)

'set the border color for the second item of the second group

CType(topicbar.Groups(1).Items(1)).ItemStyle.BorderColor = Color.AntiqueWhite

•      C#

//set the border width for the second item of the second group

((C1WebLinkItem)topicbar.Groups[1].Items[1]).ItemStyle.BorderWidth = Unit.Pixel(5)

//set the border color for the second item of the second group

((C1WebLinkItem)topicbar.Groups[1].Items[1]).ItemStyle.BorderColor = Color.AntiqueWhite;


Send comments about this topic to ComponentOne.
Copyright ฉ 1987-2009 ComponentOne LLC. All rights reserved.