Display and Editing Functions

This tab summarizes some display and editing functions:

Function

This sections axplains the various functions.

Grid

The grid overlays the current document. It does not persist in the document. Changing grid properties does not change the content.

The following snippet from demo code shows how the ribbon controls set the various Grid options through the Html Editor's Grid property.

void _spinnerGridSize_ExecuteEvent(object sender, ExecuteEventArgs e)
{
    EditorDocument.HtmlEditor.Grid.GridSize = new Size((int)_spinnerGridSize.DecimalValue, (int)_spinnerGridSize.DecimalValue);
}
 
void _buttonShowGrid_ExecuteEvent(object sender, ExecuteEventArgs e)
{
    EditorDocument.HtmlEditor.Grid.GridVisible = _togglebuttonShowGrid.BooleanValue;
    _spinnerGridSize.Enabled = _togglebuttonShowGrid.BooleanValue;
    _comboboxGridStyle.Enabled = _togglebuttonShowGrid.BooleanValue;
    _dropdownGridColor.Enabled = _togglebuttonShowGrid.BooleanValue;
}
 
void _comboboxGridStyle_ExecuteEvent(object sender, ExecuteEventArgs e)
{
    EditorDocument.HtmlEditor.Grid.GridVisualisation = (GuruComponents.Netrix.WebEditing.Behaviors.GridType)Enum.Parse(typeof(GuruComponents.Netrix.WebEditing.Behaviors.GridType), _comboboxGridStyle.StringValue);
}
 
void _dropdownGridColor_ExecuteEvent(object sender, ExecuteEventArgs e)
{
    EditorDocument.HtmlEditor.Grid.GridColor = _dropdownGridColor.Color;
}

Hint: You can show the Grid's properties in the PropertyGrid control to access all properties at once.

Positioning

In absolute position mode the editor runs in what we call "Grid Layout". Once you have few objects that overlay each other, you can set the order by several options. The HtmlSelection class exposes several features, such as BringToFront or SendToBack, as shown in the demo. Several more are available as public methods.

Options

Among the various options the demo shows the MultipleSelectionAllowed property. If on, the user can select more than one element and move, resize, or change its z-order.

Scrollbars

You can turn scrollbars on and off, set the color, retrieve the scroll position and set the current scroll position programmatically. Scrolling appears if the document size exceeds the available space. If the content fits into the window, you cannot scroll, neither using the scrollbar not programmatically.