Glossary Item Box
Custom images (non-interactive images) can be added to the toolbar to enhance the "look and feel" of the editor. To do this, simply create a new ToolbarImage, set the ImageName property, and add the ToolbarImage to the toolbar. The following code snippet demonstrates creating a custom "icon" in the upper left corner of the editor.
[C#]
// Be sure to add "Using Dart.PowerWEB.TextBox" to the top of your code-behind class.
private void Page_Load(object sender, System.EventArgs e)
{
   // Check if it is the first page request. State will be maintained for additional postbacks.
   if(!Page.IsPostBack)
   {
      // Create a custom image for our icon
      ToolbarImage icon = new ToolbarImage(ToolbarImageType.Custom);
      // Set the image name
      icon.ImageName = "custom.gif";
      // Add it as the first item, so it looks like an "icon"
      HtmlBox1.Toolbar.Items.Insert(0, icon);
   }
}
[Visual Basic]
' Be sure to add "Imports Dart.PowerWEB.TextBox" to the top of your code-behind class.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   ' Check if it is the first page request. The toolbar will maintain its state for additional postbacks.
   If Not Page.IsPostBack Then
      ' Create a custom image for our icon
      Dim icon As New ToolbarImage(ToolbarImageType.Custom)
      ' Set the image name
      icon.ImageName = "custom.gif"
      ' Add it as the first item, so it looks like an "icon"
      HtmlBox1.Toolbar.Items.Insert(0, icon)
   End If
End Sub
Send comments on this topic.
Documentation version 3.2.0.0.
© 2009 Dart Communications. All rights reserved.