ComponentOne XmlEditor for WinForms: XmlEditor for WinForms Task-Based Help > Changing the C1XmlEditor Editor Mode

Changing the C1XmlEditor Editor Mode

The C1XmlEditor 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.

      Visual Basic

Imports C1.Win.XmlEditor

      C#

using C1.Win.XmlEditor;

3.   Add the following code to the Page_Load event to set the Mode property.

      Visual Basic

C1XmlEditor1.Mode = EditorMode.Source

      C#

c1XmlEditor1.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 C1XmlEditor opens in Source view.


Send comments about this topic to ComponentOne.
Copyright © 1987-2009 ComponentOne LLC. All rights reserved.