ComponentOne FormDecorator for ASP.NET AJAX: FormDecorator for ASP.NET AJAX Task-Based Help > Changing C1FormDecorator's Built-in Visual Style

Changing C1FormDecorator’s Built-in Visual Style

This task illustrates how to change your visual style in Source view, Design view, and in code.

Changing the visual style using the designer:

To change the visual style for a Button control for example using the C1FormDecorator, follow these steps:

1.   Add a Button control to your page.

2.   Click C1FormDecorator’s smart tag to open the C1FormDecorator Tasks.

3.   Click the VisualStyles drop-down arrow and select a visual style from the list. For this example, choose Office2007Blue.

The Office2007Blue visual style is applied to the C1FormDecorator.

Changing the visual style in source view:

To change the visual style of your HTML control using the C1FormDecorator in Source view, add VisualStyle="Office2007Blue" to the <cc1:C1FormDecorator> tag so that it resembles the following:

<cc1:C1FormDecorator ID="C1FormDecorator1" runat="server" VisualStyle="Office2007Blue" VisualStylePath="~/C1WebControls/VisualStyles">

Changing the visual style programmatically:

To change the visual style, follow these steps:

1.   Import the following namespace into your project:

      Visual Basic

Imports C1.Web.UI.Controls.C1FormDecorator

      C#

using C1.Web.UI.Controls.C1FormDecorator;

2.   Add the following code to the Page_Load event:

      Visual Basic

Me.C1FormDecorator1.VisualStyle = "Office2007Blue"

      C#

this.C1FormDecorator1.VisualStyle = "Office2007Blue";

3.   Run the program.

This task illustrates the following:

The following image shows a decorated control, Button, with the Office2007Blue visual style:

 

 


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