Editor for WinForms | ComponentOne
Editor for WinForms Task-Based Help / Changing the C1Editor Mode
In This Topic
    Changing the C1Editor Mode
    In This Topic

    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

      Visual Basic
      Copy Code
      Imports C1.Win.C1Editor
      

      To write code in C#

      C#
      Copy Code
      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

      Visual Basic
      Copy Code
      C1Editor1.Mode = EditorMode.Source
      

      To write code in C#

      C#
      Copy Code
      c1Editor1.Mode = EditorMode.Source;
      
      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.