ComponentOne Slider for ASP.NET AJAX: Slider for ASP.NET AJAX Task-Based Help > Setting the Visual Style

Setting the Visual Style

The control includes several built-in visual styles, including Vista and Office 2007 styles, to style your application. For more information about available styles, see Visual Styles. You can easily change Visual Styles in Source view, in Design view, and in code using the VisualStyle property. The examples below set the VisualStyle to Vista.

Note that when you change the VisualStyle property the VisualStylePath and C1Slider.CssClass properties also change.

In Source View

In Source view add VisualStyle="Vista" to the <cc1:C1Slider> tag so it appears similar to the following:

<cc1:C1Slider ID="C1Slider1" runat="server" VisualStyle="Vista" />

From the Tasks menu

You can select a Visual Style to apply from the C1Slider Tasks menu:

1.   Click on the C1Slider's smart tag to open the C1Slider Tasks menu.

2.   Click the Visual Style drop-down arrow.

3.   In the Visual Style drop-down box select a Visual Style, for example Vista.

The Visual Style you chose will be applied to the C1Slider control.

From the Properties window

You can select a Visual Style to apply from the Properties window:

1.   Click on the C1Slider control to select it.

2.   Navigate to the Properties window and to the VisualStyle property.

3.   Type in a style to apply, for example "Vista".

The Visual Style you choose will be applied to the C1Slider control.

In Code

Add the following code to the Page_Load event to set the VisualStyle property to Vista:

      Visual Basic

Me.C1Slider1.VisualStyle = "Vista"

      C#

this.C1Slider1.VisualStyle = "Vista";

Run your project and observe:

The C1Slider will appear set to the Vista visual style:

 


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