UltimateEditor Class Library

UltimateEditor.Toolbars Property

Gets or sets the toolbars displayed on top of the editor text box.

[Visual Basic]
Public Property Toolbars As ToolbarList
[C#]
public ToolbarList Toolbars {get; set;}

Remarks

Toolbars are automatically created from the XML file specified by the EditorSource property. However, you can use this property to build your own toolbars programmatically at runtime.

Example

This sample shows how to build toolbars at runtime.

  using Karamasoft.WebControls.UltimateEditor;
  private void Page_Load(object sender, System.EventArgs e)
  {
    // If you want to create your own toolbar from scratch
    // Create a new toolbar list
    //ToolbarList tbl = new ToolbarList();
  
    // If you want to modify the original toolbars
    // Get the Toolbars property loaded from the XML file
    tbl = UltimateEditor1.Toolbars;
  
    // Create a new toolbar
    Toolbar tb = new Toolbar();
  
    // Create a new toolbar item
    ToolbarItem tbi = new ToolbarItem();
  
    // Set toolbar item properties
    tbi.Type = ToolbarItem.ItemType.Button;
    tbi.Command = ToolbarItem.CommandType.Italic;
  
    // Add toolbar item to toolbar
    tb.Add(tbi);
  
    // Add toolbar to toolbar list
    tbl.Add(tb);
  
    // Set toolbars
    UltimateEditor1.Toolbars = tbl;
  }

See Also

UltimateEditor Class | Karamasoft.WebControls.UltimateEditor Namespace