Developers Reference Guide

Summary of the interface definition for the HTML Editor for Winforms control.


HTML Editor for Winforms

Zoople HTML Editor for Winforms is an HTML segement editor for .NET Winforms, frameworks 2.0 and up.

Features

The component contains all the standard features found in stand-alone WYSIWYG HTML editors.

For example :

  • Text modifications - Bold, Italicize, strike-thru, justification, font and color settings, indenting out denting
  • HTML Tables - Can be inserted and modified, and the properties of rows and cells modified
  • Formatted Source Code Editing - More advanced end users may edit the source code of the document.
  • Cascading Style Sheets - HTML Elements may be assigned CSS class using a popmenu that displays all the CSS classes associated with a document.
  • DOM Toolbar - The editor features a HTML DOM Toolbar that displays and allows selection and modification of any HTML node in a branch of the current document
  • Property Grid - allowing for the direct editing of HTML properties in a categorized form
  • Access to the HTML DOM via the Document property - allows for iteration and manipulation of elements programmatically
  • Fully customisable toolbars and context menus
  • Integratable with spell checking libraries like nHunSpell, Phonix and so forth

Installation

download installation package: Zoople HTMLEditor setup.exe

via nuget: Install-Package Zoople.HTMLEditor -Version 1.4.2.4

Sample Visual Studio projects in C# and VB.NET are available here

API

A brief overview of the editor's API.

Properties

CurrentElement

  • returns IHTMLElement (COM)

The current selected IHTMLElement in the editable area of the control.

CurrentWindowsFormsElement

  • returns HTMLElement

The current selected managed HTMLElement in the editable area of the control.

UseRelativeURLs

Enables the control to use URL references that are relative to the BaseURL property.

BaseURL

  • String

Returns or sets the base url for the document being editted. All relative paths for images and links placed into the HTML document will use the BaseURL property to resolve the URL

UseParagraphAsDefault

  • Boolean

Use P tag as default seperator (Enter Key) otherwise use DIV

FontsList

  • String

Semi-colon delimted list of Fonts available to the end-user in WYSIWYG editing mode. Passing null defaults to system fonts.

ImageStorageLocation

  • String

Folder to store local images. All images inserted into the editor will be copied to this folder.

CSSText

  • String

Returns or sets the Cascading Style Style sheet information for the document being edited. The CSSText property will accept a well formed CSS text string. Class selectors, both global and element specific will appear in the DOM toolbar CSS styles list. Element specific selectors will only be applicable to <p> tags and global selectors to all elements (.test1 - as above). The CSSText value is not persisted in the DocumentHTML property of the control so you must include it with your email template, page snippet, final email etc before using it in you application.

LicenceKey

  • String (write only)

License Code for the HTML Editor.

InCodeView

  • Boolean

Returns a boolean value indicating whether the editor in code view mode or WYSIWYG mode.

DocumentHTML

  • String

A string value for the HTML segement currently being edited in the control.

Document

  • HTMLDocument  (Reads-only)

HTMLDocument Interface for the current edited HTML segment.

HiddenButtons

  • String

A semi-colon seperated list of button names. When included in the list the named toolbar buttons are invisible.

tsbShowCode tsbPrint tsbCut tsbCopy tsbPaste tsbUndo tsbRedo tsbBold tsbItalic tsbUnderline tsbStrikeout tsbSuperscript tsbSubscript tsbRemoveFormatting tsbAlignLeft tsbAlignCentre tsbAlignRight tsbAlignJustify tsbOrderedList tsbUnorderedList tsbOutdent tsbIndent tsbInsertLink tsbRemoveLink InsertImageToolStripButton TableOptionsToolStripMenuItem tsbForeColor tsbBackColor FontToolStripComboBox FontSizeComboBox FormatSelectionCombo tsbElementProperties

UIControlsBackgroundColor

  • Color

sets the background color of the UI - except the edit window which can controlled by redefining the background color of the BODY using the CSSText property

ToolStripItems

  • ToolStripItemCollection

enables programmatic access to the tool strip items in the upper toolbar of the control.

ToolstripImageScalingSize

  • Size

ShowPropertyGrid

  • Boolean

Show or hide the Property Grid for HTML elements.

HideMainToolbar

  • Boolean

Show or hide the Main (upper) Toolbar.

HideDOMToolbar

  • Boolean

Show or hide the DOM (lower) Toolbar.

Methods

cut_document()

  • returns void

Cuts the active selection in code view or WYSIWYG view to the clipboard.

copy_document()

  • returns void

Copies the active selection in code view or WYSIWYG view to the clipboard.

paste_document()

  • returns void

Pastes the clipboard contents to active selection in code view or WYSIWYG view.

InsertAtCursor(string HTMLText, ed_InsertType insertWhere)

  • returns void

Inserts HTML at the current cursor or selection position.

  • ed_InsertAfterSelection – insert after the current selection
  • ed_InsertBeforeSelection - insert before the current selection
  • ed_InsertReplaceSelection – replace the current selection.

bold_document()

  • returns void

Adds or removes bolding from the current text selection in WYSIWYG view.

Italic_document()

  • returns void

Adds or removes italics from the current text selection in WYSIWYG view.

Underline_document()

  • returns void

Adds or removes underlines from the current text selection in WYSIWYG view.

Strikeout_document()

  • returns void

Adds or removes strikeout from the current text selection in WYSIWYG view.

Superscript_document()

  • returns void

Adds or removes superscript from the current text selection in WYSIWYG view.

Subscript_document()

  • returns void

Adds or removes subscript from the current text selection in WYSIWYG view.

Indent_document()

  • returns void

indents the current selection in WYSIWYG view.

Outdent_document()

  • returns void

Outdents the current selection in WYSIWYG view.

Justify_Left()

  • returns void

justifies left the current selection in WYSIWYG view.

Justify_Right()

  • returns void

justifies right the current selection in WYSIWYG view.

Justify_Center()

  • returns void

justifies center the current selection in WYSIWYG view.

Justify_Full()

  • returns void

justifies full width the current selection in WYSIWYG view.

Remove_Formatting()

  • returns void

removes markup specific formatting from the current selection in WYSIWYG view.

  • returns void

Opens the insert link dialog in WYSIWYG view.

  • returns void

removes hyperlink markup from the current selection in WYSIWYG view.

undo_document()

  • returns void

undoes the most recent change.

redo_document()

  • returns void

redoes the most recent change.

numbered_list()

  • returns void

Creates a ordered list ( <OL> ) containing the current selection if there is one.

unnumbered_list()

  • returns void

Creates a un-ordered list ( <UL> ) containing the current selection if there is one.

  • returns void

Opens the standard windows print dialog allowing the currently edited document To be printed.

setFontNameOnSelection(string FontName)

  • returns void

sets the font face to be used on the current selection in WYSIWYG view.

setFontSizeOnSelection(string FontName)

  • returns void

sets the font size (1..7) to be used on the current selection in WYSIWYG view.

Events

CommandsToolbarButtonClicked

  • CommandsToolbarButtonClicked(string ButtonIdentifier, ref Boolean Cancelled)

Used to override the deault actions of the built in toolbar buttons.

ButtonIdentifier = Unique ID of the button

Cancelled = set to true to implement your own code

CancellableUserInteraction

  • CancellableUserInteraction(string InteractionType, ref Boolean Cancel)

Used to override the deault actions of the built in user interacxtions like keydown, mousedown, drag drop etc.

InteractionType = type of user interaction ("ondrop", "onkeydown", "onkeypress", "onmousedown", "onmouseup", "ondblclick")

Cancel = set to true to implement your own code or prevent the default action

ConfigurationError

  • ConfigurationError(string ErrSource, string ErrDesc)

OperationError

  • OperationError(string ErrSource, string ErrDesc)

HTMLChanged

  • HTMLChanged(object sender)