Products Support Company
Home : Tools by code

Create all tools using code

You have two ways to create tools with the editor. The first way is by using the template property and the second is by using code: the sample below shows the second way. To use it, you have to first set the property Template to an empty string, and then you can use your code to create the toolbars.


The following code creates a toolbar and a tool. As you can see, it's very easy:

ActiveUp.WebControls.Toolbar firstToolbar = new ActiveUp.WebControls.Toolbar();
firstToolbar.ID = "firstToolbar";
firstToolbar.CellSpacing = 2;
firstToolbar.Dragable = false;
firstToolbar.BorderStyle = BorderStyle.NotSet;
firstToolbar.Style["Z-INDEX"] = (zIndex).ToString();
firstToolbar.Tools.Add(new ActiveUp.WebControls.ToolBold());
firstToolbar.Tools.Add(new ActiveUp.WebControls.ToolItalic());
firstToolbar.Tools.Add(new ActiveUp.WebControls.ToolUnderline());
firstToolbar.Tools.Add(new ActiveUp.WebControls.ToolSeparator());
firstToolbar.Tools.Add(new ActiveUp.WebControls.ToolCut());
firstToolbar.Tools.Add(new ActiveUp.WebControls.ToolCopy());
firstToolbar.Tools.Add(new ActiveUp.WebControls.ToolPaste());
firstToolbar.ImagesDirectory = "medias/images/tools/";
Editor1.Toolbars.Toolbars.Add(firstToolbar);

Copyright © 2000-2005 Active Up - All Rights Reserved - Privacy Policy