| Editor for WinForms Quick Start > Step 3 of 4: Applying a Cascading Style Sheet |
In this topic you will add the code that allows you to use a cascading style sheet (CSS) when the button is clicked.
Markup
body
{
font-family: Verdana;
font-size: 10pt;
line-height: normal;
margin-bottom: 0pt;
margin-left: 0pt;
margin-right: 0pt;
margin-top: 0pt;
color: Fuchsia;
}
h1 {
font-family: Verdana;
font-size: 20pt;
font-weight: bold;
line-height: normal;
margin-bottom: 8pt;
margin-left: 0pt;
margin-right: 0pt;
margin-top: 10pt;
}
h2 {
font-family: Verdana;
font-size: 16pt;
font-weight: bold;
line-height: normal;
margin-bottom: 7pt;
margin-left: 0pt;
margin-right: 0pt;
margin-top: 9pt;
page-break-after: avoid;
}
h3 {
font-family: Verdana;
font-size: 16pt;
font-weight: bold;
line-height: normal;
margin-bottom: 7pt;
margin-left: 0pt;
margin-right: 0pt;
margin-top: 9pt;
page-break-after: avoid;
}
h4 {
font-family: Verdana;
font-size: 12pt;
font-weight: bold;
line-height: normal;
margin-bottom: 2pt;
margin-left: 0pt;
margin-right: 0pt;
margin-top: 2pt;
page-break-after: avoid;
}
.C1HBullet {
font-family: Verdana;
font-size: 10pt;
font-style: italic;
line-height: 14pt;
margin-bottom: 0pt;
margin-left: 18pt;
margin-right: 0pt;
margin-top: 5pt;
text-indent: -18pt;
}
p {
font-family: Verdana;
font-size: 10pt;
line-height: 14pt;
margin-bottom: 0pt;
margin-left: 0pt;
margin-right: 0pt;
margin-top: 5pt;
text-indent: 18pt;
}
.C1SectionCollapsed {
font-weight: bold;
}
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
C1Editor1.LoadDesignCSS("C:\myCSS.css")
End Sub
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
private void button1_Click(object sender, EventArgs e)
{
c1Editor1.LoadDesignCSS(@"C:\myCSS.css");
}
|
|
In the next step you will run the project and add text to the editor.