How To : Using StyleProjects
Contents |
[edit] Description
This document describes how to add a Style Project to a solution, and apply a StyleSheet to a form.
[edit] Prerequisites
Understanding StyleProjects
Adding a Project to a Solution
[edit] Procedure
First you add a StyleProject to your solution, then add StyleSheets to the StyleProject. Finally, you apply the StyleSheet to your form.
To add a StyleProject to a solution:
- Right-click on your solution and select Add Project.
- Follow the wizard to add a StyleProject (see Adding a Project to a Solution).
To add a StyleSheet to a StyleProject:
- Right-click on your StyleProject and select Add StyleSheet. The Style Sheet Design dialog box is displayed showing available style elements:
- In Name, type a name of the StyleSheet. To add specific style elements, select the element's check box on the left. You can select as many as needed.
- Select the name of the style element to make immediate changes to that style element's properties. For example, the figure below shows the Font style element selected.You can now make changes to the Font style element properties. (see below).
- When you're finished adding and modifying style elements, click OK. The StyleSheet is added to your solution.
- After the StyleSheet is added to your solution, you can always change style elements by selecting the style element in the Solution Detail and modifying it in the Property Editor.
To apply a StyleSheet to a form:
- Select the class that contains the form to which you want to apply the StyleSheet.
- Open the form in the Design Editor (double-click the form).
- Click in the gray area of the Design Editor to select the parent container for the form.
- In the Property Editor, click the Style tab.
- For StyleSheet, click the ellipsis button.
- In the Edit StyleSheet dialog box, for Project Style, click the ellipsis button.
- In the Select StyleSheet dialog box, expand your StyleProject and select the StyleSheet you want to apply.
- Click OK.
- In the Edit StyleSheet dialog box, click OK.
Tip You can also apply a StyleSheet to a form by dragging it directly onto an empty area of a form.
To add additional style elements:
- Right-click on the StyleSheet and select Add Style. The StyleSheet Design dialog box is displayed.
- Select the check box for the style element that you want to add. Select the name of the style element and make changes to the style's properties.
- Click OK when finished.
To changed previously added style elements:
- In the Solution Explorer, select a StyleSheet.
- In the Solution Detail, select the style element you want to change.
- In the Property Editor, change the properties for the style element.
[edit] Error Handling
[edit] Examples
[edit] Next Steps
Posting Your Application
Deploying Your Application
Managing a Deployed Application
[edit] Tags