ComponentOne WebEditor for ASP.NET: WebEditor for ASP.NET Task-Based Help > Working with Toolbars > Adding and Removing Toolbars Programmatically

Adding and Removing Toolbars Programmatically

By default, the C1WebEditor displays all of its toolbars. Because each toolbar is part of an enumeration, you cannot technically remove individual toolbars in code. Instead, you add the toolbars you want by setting the ToolBarsSet property. Once the property is set, the default toolbar settings will be overridden and only the specified toolbars will appear. In this topic, you will exclude everything but the Common and Formatting toolbars from the C1WebEditor control.

Complete the following steps:

1.   Import the following namespace into your project:

      Visual Basic

Imports C1.Web.Editor

      C#

using C1.Web.Editor;

2.   Add the following code to the Page_Load event:

      Visual Basic

C1WebEditor1.ToolBarsSet = ToolBarsSet.Common Or ToolBarsSet.Formatting

      C#

C1WebEditor1.ToolBarsSet = ToolBarsSet.Common | ToolBarsSet.Formatting;

3.   Build the project.

 This Topic Illustrates the Following:

In this topic, you used code to eliminate all but the Common and Formatting toolbars from the C1WebEditor control. The result of the steps in this topic will resemble the following:

 


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