Fast, Flexible & Easy
Menulab home > RichTextBox >  Documentation 

RichTextBox Logo RichTextBox Documentation


Member Description
Content
public property mlHtml String {get;set;} Default is "". Then the user submits the webpage, mlHtml will contain what the user have been written in RichTextBox. You can also preset the value of RichTextBox by setting mlHtml.
public method mlHtmlToText() Convenience function that strips any html tags from the value of RichTextBox. mlHtml contains html tags. mlHtmlToText() does not contain html tags.
 
Elements to include
public enum mlAvailableEditModes AvailableEditModeEnum {get;set;} Default is AvailableEditModeEnum.Default and will take a smart decision of which modes to show, which currently is based upon whether RichTextBox mlMode is TextArea or TextBox. Other possible values are Design, Html and DesignAndHtml.
public property mlShowHtmlContext Boolean {get;set;} Default is true. Html Context shows the path from BODY to the element of the cursors position and is displayed in the footer next to the Design & Html tabs. In addition you can select html elements from the Html Context.
public enum mlShowToolbar ShowToolbarEnum {get;set;} Default is ShowToolbarEnum.Default and will take a smart decision whether to show the toolbar, which currently is based upon whether RichTextBox mlMode is TextArea or TextBox. Other possible values are No and Yes.
 
Sizes
public enum mlResizeAble ResizeAbleEnum {get;set;} Default is ResizeAbleEnum.Both. Possible values : NotResizeAble, ResizeVertical, ResizeHorizontal, Both. Setting mlResizeAble=ResizeAbleEnum.Both will allow the user clientside to resize RichTextBox both vertically & horizontally.
public property mlWidth Integer {get;set} Default is 600. Refers to the combined Width of RichTextBox inclusive Toolbar, content area, Footer & borders. mlWidth can be set clientside to allow for your own resizing to parent container eg. resizing RichTextBox to ViewPort.
public property mlWidthMinimum Integer {get;set} Default is 200. While it is possible to set this value to 0, RichTextBox will resize it's Width clientside to ensure that the content area is never less than 10 pixels Width.
public property mlWidthMaximum Integer {get;set} Default is -1. If the user is allowed to change the Width of RichTextBox clientside (see mlResizeAble), mlWidthMaximum can be used to set a maximum Width of RichTextBox. Set to -1 to allow unrestricted Width.
public property mlHeight Integer {get;set} Default is 300. Refers to the combined height of RichTextBox inclusive Toolbar, content area, Footer & borders. mlHeight can be set clientside to allow for your own resizing to parent container eg. resizing RichTextBox to ViewPort.
public property mlHeightMinimum Integer {get;set} Default is 100. While it is possible to set this value to 0, RichTextBox will resize it's height clientside to ensure that the content area is never less than 10 pixels height.
public property mlHeightMaximum Integer {get;set} Default is -1. If the user is allowed to change the height of RichTextBox clientside (see mlResizeAble), mlHeightMaximum can be used to set a maximum height of RichTextBox. Set to -1 to allow unrestricted height.
 
Counters
public property mlCounters.EnforceMaxCounters Boolean {get;set} Default is true. If setting this value to true (default) and eg. mlCounters.MaxWords to 10, then the user will not be able to insert more than 10 words. If setting this value to false then the user can continue to input words even after the maximum number of words, however the Words left will start count negative in the footer.
public property mlCounters.ShowWordCount Boolean {get;set} Default is true.
public property mlCounters.MaxWords Integer {get;set} Default is 0. If value is zero (default) then there are no limitation on the number of words and also mlCounters.WordsLeftText value will not display.
public property mlCounters.WordCountText String {get;set} Default is Words .
public property mlCounters.WordsLeftText Boolean {get;set} Default is Words left .
public property mlCounters.ShowCharCount Boolean {get;set} Default is true.
public property mlCounters.MaxChars Integer {get;set} Default is 0.
public property mlCounters.CharCountText String {get;set} Default is Chars .
public property mlCounters.CharsLeftText Boolean {get;set} Default is Chars left .
public property mlCounters.ShowByteCount Boolean {get;set} Default is false. Byte count differs from word & char count that html markup are also counted, eg. "<span>my words</span>" will count 2 words, 8 chars and 21 bytes.
public property mlCounters.MaxBytes Integer {get;set} Default is 0.
public property mlCounters.ByteCountText String {get;set} Default is Bytes&nbsp;.
public property mlCounters.BytesLeftText Boolean {get;set} Default is Bytes&nbsp;left&nbsp;.
 
Media
public property mlMediaMaxFileSize Integer {get;set} Default is 10240 (10 KB).
public property mlMediaUploadFolder String {get;set} Default is Server.MapPath("~/_menulab/RichTextBox/Uploads");.
public property mlMediaValidFileExtensions List<string> {get;set} Default is new List<string>() { "png", "jpg", "gif" };.
public property mlEmoticons NameValueCollection {get;set;}.
  • Add custom Emoticon : mlEmoticons.Add("myTitle", "images/myImage.gif");
  • Remove Emoticon : mlEmoticons.Remove("BigGrin");
  • Remove all Emoticons : mlEmoticons.Clear();
 
Buttons
public property mlButtons List<RichTextBox.Button> {get;set;}.
  • Add Button : mlButtons.Add(Menulab.RichTextBox.Button.Bold);
  • Remove Button :
    int buttonIndexToRemove = -1;
    for (int i = 0; i < mlRichTextBox.mlButtons.Count; i++)
    {
    	Menulab.RichTextBox.Button button = mlRichTextBox.mlButtons[i];
    	if (button.Title == "Bold")
    	{
    		buttonIndexToRemove = i;
    		break;
    	}
    }
    if (buttonIndexToRemove > -1)
    {
    	mlRichTextBox.mlButtons.Remove(mlRichTextBox.mlButtons[buttonIndexToRemove]);
    }
    
  • Remove all Buttons : mlButtons.Clear();
 
Design
public property mlBackgroundColorDesignEditor String {get;set} Default is #fff.
public property mlBackgroundColorFooter String {get;set} Default is #F0F0EE.
public property mlBackgroundColorHtmlEditor String {get;set} Default is #fff.
public property mlBackgroundColorToolbar String {get;set} Default is #F0F0EE.
public property mlBorderColor String {get;set} Default is #ccc.
public enum mlBorderStyle BorderStyleEnum {get;set} Default is BorderStyle.Solid.
public property mlBorderWidth Integer {get;set} Default is 1.
public property mlCssClassCounters String {get;set} Default is ml_richtextbox_counters. //{ font-size:10px;font-family:Arial; }
public property mlCssClassDialogHeader String {get;set} Default is ml_richtextbox_dialogHeader. //{background-color:#CFEAFF;padding-left:2px;color:#000;font-family:Arial;font-size:12px;height:22px;line-height:22px;}
public property mlCssClassHtmlContext String {get;set} Default is ml_richtextbox_htmlcontext.
If you set a custom css class for mlCssClassHtmlContext, say you call it .myHtmlContext, then you will need to also set descendant A selectors - the following will give the same result as the default values :
  • .myHtmlContext {font-size:9px;font-weight:bold;font-family:Arial;color:#999;}
  • .myHtmlContext a {text-decoration:none;color:#999;}
  • .myHtmlContext a:hover {color:#fff;background-color:#9FD3FB;}
 
Miscellaneous
public enum mlInitialEditMode EditModeEnum {get;set} Default is EditModeEnum.Design. This member sets which editor (Design or Html) that is initial selected then RichTextBox loads (only relevant if both Design & Html editors are available).
public enum mlDisplayMode DisplayModeEnum {get;set} Default is DisplayModeEnum.Block. This member sets RichTextBox in either block or inline display.
public enum mlMode ModeEnum {get;set} Default is ModeEnum.TextArea. This member will write RichTextBox out as either a TextArea or as a TextBox. If mlMode is set to TextBox, then Html editor & Toolbar & Footer will not show if the members controlling them are set to default.
public property mlSetFocusOnLoad Boolean {get;set} Default is true.
public property mlUndoLength Integer {get;set} Default is 10. If set to eg. 10 it means that the undo button can be pressed up to 10 times after which RichTextBox cannot undo earlier changes. Do not set too high on editors that receives very long texts.

Terms & Conditions    |    Privacy Policy    |    Sitemap    |    Copyright © Menulab 2012. All rights reserved.