Control Reference > 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:
Gets or sets the description of the control used by accessibility client applications. |
|
Gets or sets the name of the control used by accessibility client applications. |
|
Gets or sets the role of the control used by accessibility client applications. |
|
Gets or sets the value of the control used by accessibility client applications. |
|
Executes actions such as clear, show, and print. |
|
Appearance |
See the Visual Basic documentation. |
BackColor |
See the Visual Basic documentation. |
Returns or sets whether text is transparent or opaque. |
|
BorderStyle |
See the Visual Basic documentation. |
Returns or sets the brush color. |
|
Returns or sets the brush style. |
|
*Draw |
Draws an object within the rectangle defined by the X1, Y1, X2, and Y2 properties. |
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. |
Returns or sets whether text should keep its aspect ratio when the drawing is resized. |
|
Returns or sets the amount of change to the ScrollLeft property when the user clicks the scroll bar area. |
|
Returns or sets the amount of change to the ScrollTop property when the user clicks the scroll bar area. |
|
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. |
Returns or sets whether contents may be scrolled by dragging the VSDraw's client area. |
|
Returns or sets the physical height of the drawing, in twips. |
|
Returns or sets the physical width of the drawing, in twips. |
|
Returns or sets the pen color. |
|
Returns or sets the pen style. |
|
Returns or sets the pen width, in logical units. |
|
Returns a snapshot of the current drawing. |
|
Draws a polygon defined by a string of X,Y coordinates. |
|
Draws a line defined by a string of X,Y coordinates. |
|
Returns or sets whether the scrollbar thumbs should be proportional to the size of the visible area. |
|
Returns or sets the number of logical units for the vertical dimension of the drawing. |
|
Returns or sets the horizontal coordinate for the left edge of the drawing. |
|
Returns or sets the vertical coordinate for the top edge of the drawing. |
|
Returns or sets the number of logical units for the horizontal dimension of the drawing. |
|
Returns or sets the left coordinate of the visible area, in twips. |
|
Returns or sets the top coordinate of the visible area, in twips. |
|
Returns or sets the amount of change to the ScrollLeft property when the user clicks the scroll arrow. |
|
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. |
Returns or sets the text alignment. |
|
Returns or sets the text angle, in tenths of degrees. |
|
Returns or sets the text color. |
|
Returns the height of a string in scale units. |
|
Returns the width of a string in scale units. |
|
Returns or sets whether scrolling occurs as the user drags the scroll thumb. |
|
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. |
Sets or returns the zoom mode (explicit percentage or one of the automatic settings). |
Resets the control and discards its contents. |
|
Converts mouse coordinates to page coordinates. |
|
*Copy |
Updates the drawing and copies it to the clipboard. |
Draws a circle, circular wedge, or circular arc. |
|
Draws an ellipse, wedge, or arc. |
|
Draws a line segment. |
|
Draws a bitmap or an icon. |
|
Draws a rectangle. |
|
Loads a VSDraw document (metafile) from disk. |
|
Converts page coordinates to mouse coordinates. |
|
Updates the drawing and copies it to the printer. |
|
*Refresh |
See the Visual Basic documentation. |
Saves a VSDraw document (metafile) to disk. |
|
Sets the PageWidth and PageHeight properties. |
|
*Show |
Updates the drawing and shows it on the screen. |
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. |
Fired after the control scrolls its contents. |