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

ImageUrl Property

The ImageUrl property gets or sets the URL of the image to use in place of an icon.

This example assigns the ImageUrl property to the ItemStyle object.

      Visual Basic

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

'assign the ImageUrl property to the ItemStyle

topicbar.ItemStyle.ImageUrl = "~/Images/house.gif"

      C#

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

//assign the ImageUrl property to the ItemStyle;

topicbar.ItemStyle.ImageUrl = "~/Images/house.gif";

 

This example assigns the ImageUrl property to the second item in Group 1.

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. Please see the Tree View Control Type in the ItemStyle Class topic section, for a generic example how to set a specific item for the C1WebMenu and the C1WebTreeView.

      Visual Basic

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

'assign the ImageUrl property to the ItemStyle

CType(topicbar.Groups(0).Items(1), C1WebLinkItem).ItemStyle.ImageUrl = "~/Images/house.gif"

      C#

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

//assign the ImageUrl property to the ItemStyle

((C1WebLinkItem)topicbar.Groups[0].Items[1]).ItemStyle.ImageUrl = "~/Images/house.gif";

 


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