Table of Contents

Class VectorDrawBaseControl

Namespace
VectorDraw.Professional.Control
Assembly
VDrawBaseControl.dll

Represents a Windows Forms control that renders and manages a VectorDraw document component.

public class VectorDrawBaseControl : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Inheritance
VectorDrawBaseControl
Implements
Inherited Members

Examples

// Create and configure a VectorDrawBaseControl
VectorDrawBaseControl drawControl = new VectorDrawBaseControl();
drawControl.dock = DockStyle.Fill;
this.Controls.Add(drawControl);
//Use ActiveDocument property to get the current document
drawControl.ActiveDocument.Open("example.vdml");
drawControl.ActiveDocument.Redraw(false);
// Subscribe to events
drawControl.Draw += new DrawEventHandler(OnDraw);
drawControl.ActionStart += new ActionStartEventHandler(OnActionStart);

Remarks

The VectorDrawBaseControl is the primary control for integrating VectorDraw functionality into Windows Forms applications. It provides a rendering surface for vdDocument objects and manages all user interactions including mouse, keyboard, and touch input.

Key Features:

  • Document Management: Set and manage active documents via SetActiveDocument(vdDocument) and ActiveDocument property
  • Event System: Extensive event support for document lifecycle, drawing, modifications, and actions
  • Touch Support: Multi-touch gesture recognition for zoom, pan, and rotate operations
  • Input Device Support: SpaceNavigator 3D mouse support via inputDeviceManager
  • File Operations: Load and save documents from streams and files

The control handles Windows messages, input events, rendering, and document state management. It acts as a bridge between the user interface and the VectorDraw document model.

Constructors

VectorDrawBaseControl()

Main constructor of the VectorDrawBaseControl.

Properties

ActiveDocument

Gets or sets the active vdDocument object.

BackColor

Gets or sets the background color for the control.

BackgroundImage

Gets or sets the background image displayed in the control.

BackgroundImageLayout

Gets or sets the background image layout as defined in the ImageLayout enumeration.

CanEnableIme

Gets a value indicating whether the System.Windows.Forms.Control.ImeMode property can be set to an active value, to enable IME support.

Font

Gets or sets the font of the text displayed by the control.

ForeColor

Gets or sets the foreground color of the control.

InputDevice_SpaceMouse

Returns the manager for SpaceNavigator device

InputDevice_TouchGesture

Returns the manager for Touch Gesture

LayOut

Gets or sets the active vdLayout object. ActiveLayOut

inputDeviceManager

Get the Manager for additional input device like touch gesture screens and SpaceNavigator devices

Methods

Dispose(bool)

Clean up any resources being used.

EnsureDocument()

Select a new vdDocument object if the Selected document is null.

GetCustomMousePointer()

Get the selected Cursor.

GetOpenDialogFilter()

A public method that returns the filter string used in our open dialog.

GetSaveDialogFilter()

A public method that returns the filter string used in our save dialog.

IsInputKey(Keys)

Determines whether the specified key is a regular input key or a special key that requires preprocessing.

LoadFromStream(vdDocument, Stream, string)

Loads a vdDocument from a stream.

OnCreateControl()

Raises the CreateControl() method and ControlCreated event

OnDoubleClick(EventArgs)

Raises the DoubleClick vdDoubleClick

OnDragDrop(DragEventArgs)

Raises the DragDrop vdDragDrop and DragDrop(object, DragEventArgs)

OnDragEnter(DragEventArgs)

Raises the DragEnter vdDragEnter and DragEnter(object, DragEventArgs)

OnDragLeave(EventArgs)

Raises the DragLeave vdDragLeave and DragLeave(object, EventArgs)

OnDragOver(DragEventArgs)

Raises the DragOver vdDragOver and DragOver(object, DragEventArgs)

OnGotFocus(EventArgs)

Raises the GotFocus GotFocus(object, EventArgs) and vdGotFocusevent.

OnHandleCreated(EventArgs)

Raises the HandleCreated event.

OnHandleDestroyed(EventArgs)

Raises the HandleDestroyed(object, EventArgs) HandleDestroyed and vdHandleDestroyed

OnInvalidated(InvalidateEventArgs)

Raises the Invalidated Invalidated(object, Rectangle) and vdInvalidated

OnKeyDown(KeyEventArgs)

Raises the KeyDown vdKeyDown and KeyDown(object, KeyEventArgs).

OnKeyPress(KeyPressEventArgs)

Raises the KeyPress vdKeyPress and KeyPress(object, KeyPressEventArgs)

OnKeyUp(KeyEventArgs)

Raises the KeyUp vdKeyUp and KeyUp(object, KeyEventArgs)

OnLoad(EventArgs)

Fires when the control is loaded.

OnLostFocus(EventArgs)

Raises the LostFocus LostFocus(object, EventArgs) and vdLostFocus event. event.

OnMouseClick(MouseEventArgs)

Raises the MouseClick vdMouseClick and MouseClick(object, MouseEventArgs)

OnMouseDoubleClick(MouseEventArgs)

Raises the MouseDoubleClick vdMouseDoubleClick and MouseDoubleClick(object, MouseEventArgs)

OnMouseDown(MouseEventArgs)

Raises the MouseDown vdMouseDown and MouseDown(object, MouseEventArgs)

OnMouseEnter(EventArgs)

Raises the MouseEnter vdMouseEnter and MouseEnter(object, EventArgs)

OnMouseHover(EventArgs)

Raises the MouseHover vdMouseHover and MouseHover(object, EventArgs)

OnMouseLeave(EventArgs)

Raises the MouseLeave vdMouseLeave and MouseLeave(object, EventArgs)

OnMouseMove(MouseEventArgs)

Raises the MouseMove vdMouseMove MouseMove(object, MouseEventArgs) and MouseMoveAfter

OnMouseUp(MouseEventArgs)

Raises the MouseUp vdMouseUp and MouseUp(object, MouseEventArgs)

OnMouseWheel(MouseEventArgs)

Raises the MouseWheel vdMouseWheel and MouseWheel(object, MouseEventArgs)

OnPaint(PaintEventArgs)

Raises the Paint Paint(Control, PaintEventArgs) and vdPaint

OnQueryContinueDrag(QueryContinueDragEventArgs)

Raises the QueryContinueDrag

OnResize(EventArgs)

Raises the Resize vdResize and Resize(Control)

ProcessCmdKey(ref Message, Keys)

Processes a command key.

RaiseActionEnd(object, string)

Raise the ActionEnd event.

RaiseActionError(object, string)

Raise the ActionError event.

RaiseActionStart(object, string, ref bool)

Raise the ActionStart event.

RaiseFilterActionPoint(object, object, ref gPoint)

Raise the FilterActionPoint event.

RaiseGetDimensionText(object, ref string)

Raise the GetDimensionText event.

RaiseGripSelectionModified(object, vdLayout, vdSelection)

Raise the GripSelectionModified event.

ReFresh()

Refreshes the graphics by drawing the memory bitmap of the render into the control device.

Redraw()

Redraws the client area of the active control window.

SetActiveDocument(vdDocument)

Select a new vdDocument object.

SetCustomMousePointer(Cursor)

Select a new Cursor.

WndProc(ref Message)

Processes Windows messages.

Events

ActionDraw

Fires before the active action is drawn.

ActionDrawOsnap

Fires before the osnaps are drawn.

ActionEnd

Fires when a command action is finished(CmdArc).

ActionError

Fires when an command action is canceled with an error.

ActionJobLoop

Fires Continually when an action is active and started .

ActionJobLoopEx

Fires Continually when an action is active and started .

ActionLayoutActivated

Fires after ActiveLayOut property is changed.

ActionStart

Fires before a command action is started(CmdArc).

AddItem

Fires before an object is added to a collection.

AfterAddItem

Fires after an object is added to a collection.

AfterModifyObject

Fires after a change to a property of an object.

AfterNewDocument

Fires after the New() method.

AfterOpenDocument

Fires after opening a file.

BeforeModifyObject

Fires before a change to a property of an object.

BeforeOpenDocument

Fires before opening a file.

ControlCreated

Fires when the control created.

Draw

Fires before all figures are drawn.

DrawAfter

Fires after all figures are drawn.

DrawAfterFigure

Fires after a vdFigure is drawn.

DrawBackground

Fires before the draw of the background.

DrawFigure

Fires before a vdFigure is drawn.

DrawOverAll

Fires before the coordinate axis is drawn.

EraseObject

Fires before an object is set as deleted.

FigureDrawGrips

Fires before the draw of the grip points of a vdFigure object.

FilterActionPoint

Fires after an action waiting a point is finished.

FilterFigure

Fires when an object is inserted into a collection.

GetDimensionText

Fires before the dimension's text is calculated

GetFileImagePreview

Fires when the opendialog is called in order to display a preview image of a file that is not supported.

GetGripPoints

Fires before GetGripPoints() method.

GetOpenFileFilterFormat

Fires before the open dialog in order to filter the supported open extensions.

GetPassWord

Fires whne a drawing is open and it is password protected.

GetSaveFileFilterFormat

Fires before the open dialog in order to filter the supported save extensions.

GripSelectionModified

Fires when vdFigure objects are added or removed in the active grip selection.

InitBaseAction

Fires before the default BaseAction is added to the action stack of the document.

InitializeDocument

Fires when the selected vdDocument changed.

IsValidOpenFormat

Fires before Open(string) method and when the file's extendion is not implmented from VectorDraw.

LoadUnknownFileName

Fires When an unsupported file extension is opened.

MouseMoveAfter

Occurs after the mouse pointer is moved over the control.

MoveGripPointsAt

Fires when a default move of a grip point of a vdFigure object.

NoFileFind

Fires when a file is not found to the support path.

OnActionMouseMove

Fires after a Mouse move operation of active action is finished.

OnTimer

Fires when Windows Message Queue is empty.

OpenUrl

Fires before the default execution of the explorer opening a URL.

Progress

Fires when a progress operation is changed.

Prompt

Fires when a Prompt(string) method is called.

ResizeControlWindow

Fires when the control is resized.

SaveUnknownFileName

Fires When an unsupported file extension is saved.

SelectionsAddItem

Occurs before adding one item to the vdSelections collection.

SelectionsRemoveAllItems

Occurs after removing all items from the vdSelections collection.

SelectionsRemoveItem

Occurs after removing an item from the vdSelections collection.

UnInitializeDocument

Fires when the selected vdDocument set to null.

WindowProc

Fires when a Windows message is going to be evaluate.

vdDoubleClick

Occurs when the control is double-clicked.

vdDragDrop

Fires when a drag-and-drop operation is completed.

vdDragEnter

Occurs when a drag-and-drop operation is completed.

vdDragLeave

Occurs when an object is dragged out of the control's bounds.

vdDragOver

Occurs when an object is dragged over the control's bounds.

vdGotFocus

Occurs when the control receives focus.

vdHandleDestroyed

Fires when this control window is destroyed.

vdInvalidated

Fires when a Invalidate() method is called.

vdKeyDown

Occurs when a key is pressed while the control has focus.

vdKeyPress

Occurs when a key is pressed while the control has focus.

vdKeyUp

Occurs when a key is released while the control has focus.

vdLostFocus

Occurs when the control loses focus.

vdMouseClick

Occurs when the control is clicked by the mouse.

vdMouseDoubleClick

Occurs when the control is double clicked by the mouse.

vdMouseDown

Occurs when the mouse pointer is over the control and a mouse button is pressed.

vdMouseEnter

Occurs when the mouse pointer enters the control.

vdMouseHover

Occurs when the mouse pointer rests on the control.

vdMouseLeave

Occurs when the mouse pointer leaves the control.

vdMouseMove

Occurs when the mouse pointer is moved over the control.

vdMouseUp

Occurs when the mouse pointer is over the control and a mouse button is released.

vdMouseWheel

Occurs when the mouse wheel moves while the control has focus.

vdPaint

Fires when this control window need to be paint.

vdResize

Occurs when the control is resized.

vdScroll

Fires when a scrolling action is commited.

See Also