# Changing the C1Editor Mode

Learn how to change the modes (Design, Source and Preview) of C1Editor for WinForms control

## Content



The [C1Editor](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.html) control features three editor modes: **Design**, **Source**, and **Preview**. You can determine which of these views users will see initially by setting the [Mode](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.Mode.html) 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.
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    Imports C1.Win.C1Editor
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    using C1.Win.C1Editor;
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
3.  Add the following code to the **Page\_Load** event to set the Mode property.
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    C1Editor1.Mode = EditorMode.Source
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    c1Editor1.Mode = EditorMode.Source;
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    
	> 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.