Editor for WinForms | ComponentOne
Editor for WinForms Task-Based Help / Loading an XHTML Document from a File
In This Topic
    Loading an XHTML Document from a File
    In This Topic

    You can load an XHTML document into the C1Editor using the LoadXml method.

    1. In the Visual Studio Solution Explorer, right-click the project name, select New Folder, and name it Xhtml.
    2. Place the XHTML document you would like to load into this folder. For this example, we will use a document named "galaxy.htm".
    3. Click the View menu and select Code to switch to Source view, if necessary.
    4. Add the following statements to your project.

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Imports C1.Win.C1Editor
      Imports System.IO
      

      To write code in C#

      C#
      Copy Code
      using C1.Win.C1Editor;
      using System.IO;
      
    5. Add the following code to the Page_Load event. This code uses the LoadXml method to load your XHTML document into the C1Editor. You will need to update the file path to the location of the XHTML document on your machine.

      To write code in Visual Basic

      Visual Basic
      Copy Code
      C1Editor1.LoadXml("C:\galaxy.htm")
      

      To write code in C#

      C#
      Copy Code
      c1Editor1.LoadXml(@"C:\galaxy.htm");
      
    6. Run the project and the C1Editor will show your XHTML document.