[]
Now you can bind C1Editor to a document that can be saved to a file and loaded later when needed. If this document is edited within the C1Editor, the underlying XmlDocument syncs to match it.
Click the View menu and select Code to switch to code view.
Add the following Imports (Visual Basic) or using (C#) statements to your project so you can use abbreviated names.
To write code in Visual Basic
Imports System.Xml
Imports C1.Win.C1Editor
To write code in C#
using System.Xml;
using C1.Win.C1Editor;
Create a Form_Load event and add the following code there to create a new document and bind it to C1Editor:
To write code in Visual Basic
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim myDoc As New XmlDocument()
C1Editor1.Document = myDoc
End Sub
To write code in C#
private void Form1_Load(object sender, EventArgs e)
{
XmlDocument myDoc = new XmlDocument();
c1Editor1.Document = myDoc;
}
In the next step you will add code to apply a cascading style sheet to the C1Editor content.