ComponentOne VSView 8.0
VSDraw Control

The VSDraw control lets you create detailed, scaleable, resolution-independent drawings. The drawings can be shown on your forms, printed, save to disk or copied to the Windows clipboard, where they become available for pasting into other Windows applications such as Microsoft Word.

The coordinate system used to create and display the drawing is determined by the programmer using the ScaleWidth, ScaleHeight, ScaleLeft, and ScaleTop properties (similar to the VB's PictureBox control). These properties may be modified after the drawing has been created, and the changes will be reflected on the display.

The scaling is used for all drawing and measurements, including font height. For example, if the ScaleHeight property is set to 1000 and the FontSize property is set to 100, then the font height corresponds to 1/10th of the control height.

After the drawing is created, you can change the drawing extents to provide distortion and zoom. Use the VSDraw control to create custom maps, charts, diagrams or whatever graphics you need.

The VSDraw control is based on Windows metafile technology, which has limited support for text manipulation. This makes it less than ideal for text-intensive applications. If you need to handle a lot of text, use the VSPrinter control instead.

Note: Before you can use a VSDraw control in your application, you must add the VSDraw8.ocx file to your project. Please refer to the VB documentation for details on adding controls to your projects.

To distribute applications you create with the VSDraw control, you must install and register it on the user's computer. The Setup Wizard provided with Visual Basic provides tools to help you do that. Please refer to the Visual Basic manual for details.

The VSDraw control provides the following properties, events and methods:

All of the properties, events and methods for the VSDraw control are listed in the following tables. Properties, events and methods that apply only to this control, or that require special consideration when used with it, are marked with an asterisk (*). These are documented in later sections. For documentation on the remaining properties, see the Visual Basic documentation.

Properties

*AccessibleDescription

Gets or sets the description of the control used by accessibility client applications.

*AccessibleName

Gets or sets the name of the control used by accessibility client applications.

*AccessibleRole

Gets or sets the role of the control used by accessibility client applications.

*AccessibleValue

Gets or sets the value of the control used by accessibility client applications.

*Action

Executes actions such as clear, show, and print.

Appearance

See the Visual Basic documentation.

BackColor

See the Visual Basic documentation.

*BackStyle

Returns or sets whether text is transparent or opaque.

BorderStyle

See the Visual Basic documentation.

*BrushColor

Returns or sets the brush color.

*BrushStyle

Returns or sets the brush style.

*Draw

Draws an object within the rectangle defined by the X1, Y1, X2, and Y2 properties.

*EmptyColor

Returns or sets the color of the area around the preview page.

Enabled

See the Visual Basic documentation.

Font

See the Visual Basic documentation.

hWnd

See the Visual Basic documentation.

*KeepTextAspect

Returns or sets whether text should keep its aspect ratio when the drawing is resized.

*LargeChangeHorz

Returns or sets the amount of change to the ScrollLeft property when the user clicks the scroll bar area.

*LargeChangeVert

Returns or sets the amount of change to the ScrollTop property when the user clicks the scroll bar area.

*LineSpacing

Returns or sets the line spacing as a percentage (for example, 100% is single spacing, 200% is double spacing).

MouseIcon

See the Visual Basic documentation.

MousePointer

See the Visual Basic documentation.

*MouseScroll

Returns or sets whether contents may be scrolled by dragging the VSDraw's client area.

*PageHeight

Returns or sets the physical height of the drawing, in twips.

*PageWidth

Returns or sets the physical width of the drawing, in twips.

*PenColor

Returns or sets the pen color.

*PenStyle

Returns or sets the pen style.

*PenWidth

Returns or sets the pen width, in logical units.

*Picture

Returns a snapshot of the current drawing.

*Polygon

Draws a polygon defined by a string of X,Y coordinates.

*Polyline

Draws a line defined by a string of X,Y coordinates.

*ProportionalBars

Returns or sets whether the scrollbar thumbs should be proportional to the size of the visible area.

*ScaleHeight

Returns or sets the number of logical units for the vertical dimension of the drawing.

*ScaleLeft

Returns or sets the horizontal coordinate for the left edge of the drawing.

*ScaleTop

Returns or sets the vertical coordinate for the top edge of the drawing.

*ScaleWidth

Returns or sets the number of logical units for the horizontal dimension of the drawing.

*ScrollLeft

Returns or sets the left coordinate of the visible area, in twips.

*ScrollTop

Returns or sets the top coordinate of the visible area, in twips.

*SmallChangeHorz

Returns or sets the amount of change to the ScrollLeft property when the user clicks the scroll arrow.

*SmallChangeVert

Returns or sets the amount of change to the ScrollTop property when the user clicks the scroll arrow.

*Text

Prints a string starting at the point defined by the X1, Y1 properties.

*TextAlign

Returns or sets the text alignment.

*TextAngle

Returns or sets the text angle, in tenths of degrees.

*TextColor

Returns or sets the text color.

*TextHeight

Returns the height of a string in scale units.

*TextWidth

Returns the width of a string in scale units.

*Track

Returns or sets whether scrolling occurs as the user drags the scroll thumb.

*Version

Returns the version of the control currently loaded.

*X1

Returns or sets the left coordinate of the rectangle used with the Draw property.

*X2

Returns or sets the right coordinate of the rectangle used with the Draw property.

*Y1

Returns or sets the top coordinate of the rectangle used with the Draw property.

*Y2

Returns or sets the bottom coordinate of the rectangle used with the Draw property.

*Zoom

Returns or sets the preview scale: set to a percentage, or zero to fill the control.

*ZoomMode

Sets or returns the zoom mode (explicit percentage or one of the automatic settings).


Methods

*Clear

Resets the control and discards its contents.

*ClientToPage

Converts mouse coordinates to page coordinates.

*Copy

Updates the drawing and copies it to the clipboard.

*DrawCircle

Draws a circle, circular wedge, or circular arc.

*DrawEllipse

Draws an ellipse, wedge, or arc.

*DrawLine

Draws a line segment.

*DrawPicture

Draws a bitmap or an icon.

*DrawRectangle

Draws a rectangle.

*LoadDoc

Loads a VSDraw document (metafile) from disk.

*PageToClient

Converts page coordinates to mouse coordinates.

*PrintDoc

Updates the drawing and copies it to the printer.

*Refresh

See the Visual Basic documentation.

*SaveDoc

Saves a VSDraw document (metafile) to disk.

*SetPageExtent

Sets the PageWidth and PageHeight properties.

*Show

Updates the drawing and shows it on the screen.


Events

Click

See the Visual Basic documentation.

DblClick

See the Visual Basic documentation.

KeyDown

See the Visual Basic documentation.

KeyPress

See the Visual Basic documentation.

KeyUp

See the Visual Basic documentation.

MouseDown

See the Visual Basic documentation.

MouseMove

See the Visual Basic documentation.

MouseUp

See the Visual Basic documentation.

*Scroll

Fired after the control scrolls its contents.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback