Glossary Item Box
Custom text (non-interactive text) can be added to the toolbar to enhance the editor. To do this, simply create a new ToolbarText, set the Text property, and add the ToolbarText to the toolbar. The following code snippet demonstrates creating adding "banner" text to the top of the toolbar.
[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 text
ToolbarText banner = new ToolbarText(ToolbarTextType.Custom);
// Change the style of the text to make it stand out
banner.Width = new Unit("100%");
banner.Font.Bold = true;
banner.BackColor = Color.Red;
banner.ForeColor = Color.White;
// Set the text
banner.Text = "Welcome to the PowerWEB HtmlBox for ASP.NET editor demo";
// Add it as the first item, then add a row
HtmlBox1.Toolbar.Items.Insert(0, banner);
HtmlBox1.Toolbar.Items.Insert(1, new ToolbarImage(ToolbarImageType.RowSeparator));
}
}
[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 text
Dim banner As New ToolbarText(ToolbarTextType.Custom)
' Change the style of the text to make it stand out
banner.Width = New Unit("100%")
banner.Font.Bold = True
banner.BackColor = Color.Red
banner.ForeColor = Color.White
' Set the text
banner.Text = "Welcome to the PowerWEB HtmlBox for ASP.NET editor demo"
' Add it as the first item, then add a row
HtmlBox1.Toolbar.Items.Insert(0, banner)
HtmlBox1.Toolbar.Items.Insert(1, new ToolbarImage(ToolbarImageType.RowSeparator))
End If
End Sub
Send comments on this topic.
Documentation version 3.2.0.0.
© 2009 Dart Communications. All rights reserved.