[]
        
(Showing Draft Content)

Changing the C1Editor Mode

The C1Editor control features three editor modes: Design, Source, and Preview. You can determine which of these views users will see initially by setting the Mode property.

  1. In Visual Studio, click the View menu and select Code to switch to Source view, if necessary.

  2. Add the following statement to your project.

    To write code in Visual Basic

    Imports C1.Win.C1Editor
    

    To write code in C#

    using C1.Win.C1Editor;
    
  3. Add the following code to the Page_Load event to set the Mode property.

    To write code in Visual Basic

    C1Editor1.Mode = EditorMode.Source
    

    To write code in C#

    c1Editor1.Mode = EditorMode.Source;
    

    type=note

    Note:Please note this sample changes the editor mode to Source. You can also set this property to Design or Preview.

  4. Press F5 to build the project and observe C1Editor opens in Source view.