RichTextBoxToolbarButton
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
A button added to the toolbar of a RichTextBox by the application.
- C#
- VB.NET
public class RichTextBoxToolbarButton : INotifyPropertyChanged
Public Class RichTextBoxToolbarButton
Inherits INotifyPropertyChanged
Add it to ToolbarButtons; a click raises ToolbarButtonClick with the edits made so far already on the server.
Example:
editor.ToolbarButtons.Add(new RichTextBoxToolbarButton("signature", "Images/sign.svg", "Insert signature"));
editor.ToolbarButtonClick += (s, e) => {
if (e.Button.Name == "signature") editor.SelectedHtml = "<p><b>" + userName + "</b></p>";
};
Constructors
RichTextBoxToolbarButton()
Creates a button without a name.
RichTextBoxToolbarButton(name, imageSource, toolTipText)
Creates a button.
| Name | Type | Description |
|---|---|---|
| name | String | The name passed back by ToolbarButtonClick. |
| imageSource | String | The icon: a theme icon name, a URL or a file of the application. |
| toolTipText | String | The tooltip. |
Properties
Enabled
Boolean: Gets or sets whether the button can be clicked; the whole toolbar is disabled while the editor is read-only. (Default: True)
ImageSource
String: Gets or sets the icon: a theme icon name, a URL or a file of the application. (Default: "")
Name
String: Gets or sets the name that identifies the button in ToolbarButtonClick. (Default: "")
Tag
Object: Gets or sets an object with data about the button. (Default: null)
Text
String: Gets or sets the caption; it is shown when there is no icon. (Default: "")
ToolTipText
String: Gets or sets the tooltip. (Default: "")
Events
PropertyChanged
PropertyChangedEventHandler Occurs when a property changes, so that the toolbar is updated.