qbd software ltd [UK]
qweb  > moth > qbd software
html edit Using MSHTML Edit and the DHTML Edit Control.
Page: 10 Dec 2001
 
Links
qweb
Equivalent
Source Format
 
New
Source Format - a routine to format source code in MSHTML Editing as a replacement for SourceCodePreservation.
 
Contact
Mail Moth

Introduction

With IE4 Microsoft introduced the DHTML Edit component (dhtmled.ocx).  It allowed the developer to add a powerful and flexible WYSIWYG HTML editor to their applications.  Microsoft did provide some documentation which can now be found in the MSDN Archives.

With Internet Explorer 5.5, Microsoft introduced MSHTML Edit as a replacement for the DHTMLEdit control.  Microsoft no longer intend to support DHTML Edit and say it was a wrapper class for MSHTML editing  - see What Ever Happened to the DHTML Edit Control (Listed in Contents) and The DHTML Edit Control (Listed in Contents).

The Differences

DHTML Editing Component includes the following (from Microsoft):

  • Table operations (insert row, insert column, merge cells, and so on).
  • Absolute drop mode.
  • Source code white space and formatting preservation.
  • Active Server Page script preservation.
  • Loading and saving files.
  • Context menu support.
  • Keyboard accelerators.
  • Properties, methods, and events that expose editing functionality.

The suggestion is that MSHTML Editing is so powerful and customisable that these features can generally be replaced with custom routines.

The Implications

The customisation of MSHTML Editing involves implementing Edit Designers (IHTMLEditDesigner).  Edit Designers can be used to intercept events in MSHTML Editing and change the resulting behaviour of the Editor.  The DHTMLEdit component included some of these editor customisations.

A good example would be Table operations.  In the image below the user makes a selection of cells from B2 to C3:

Edit Designer implications: selecting cells in a table in DHTMLEdit and MSHTML Editing

With DHTMLEdit the selection is a bounding rectangle between the two cells whereas in MSHTML the selection is inline (every item between Cell B2 and Cell B3).

The Problem

The problem is that Edit Designers cannot be implemented in Visual Basic.  We can only work with the events available through the HTML Document object.

Toward a solution ...

I am aiming to build up a library of examples that can be used to replace the features that are missing (where possible).

Articles

DHTML Edit Component / MSHTML Edit Equivalents
qWeb Equivalent - The methods and properties in MSHTML Editing equivalent to DHTML Edit
SourceCodePreservation
qFormat - A Visual Basic SourceCodePreservation routine that works in a similar way to Microsoft FrontPage.

©2001-2004 qbd software ltd