ComponentOne SuperPanel for ASP.NET AJAX: SuperPanel for ASP.NET AJAX Task-Based Help > Customizing C1SuperPanel's Appearance > Changing the Font

Changing the Font

To further customize your application, you can easily set the font of the C1SuperPanel to be similar to the font selected throughout your application. You can easily change the font in Source view, from the Properties window, and in code.

In Source View

In Source view add text to the <cc1:C1SuperPanel> tag so it appears similar to the following:

<cc1:C1SuperPanel ID="C1SuperPanel1" runat="server"

            style="top: 0px; left: 0px; height: 85px" Font-Bold="True"

            Font-Names="Arial" Font-Size="Small" ForeColor="Red"

            VisualStylePath="~/C1WebControls/VisualStyles">

            <ContentTemplate>

                Here is red text.

            </ContentTemplate>

When you run your application, the text in the body of the C1SuperPanel control will now appear small, bold, red, and in the Arial font.

In Code

Add the following code to the Page_Load event to customize the font's appearance:

      Visual Basic

Me.C1SuperPanel1.Font.Bold = True

Me.C1SuperPanel1.Font.Name = "Arial"

Me.C1SuperPanel1.Font.Size = FontUnit.Small

Me.C1SuperPanel1.ForeColor = Color.Red

      C#

this.C1SuperPanel1.Font.Bold = true;

this.C1SuperPanel1.Font.Name = "Arial";

this.C1SuperPanel1.Font.Size = FontUnit.Small;

this.C1SuperPanel1.ForeColor = Color.Red;

Note: The System.Drawing namespace must be imported for the above code to work correctly.

When you run your application, the text in the body of the C1SuperPanel control will now appear small, bold, red, and in the Arial font.

 


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