Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Visual Basic 6 Black Book
(Publisher: The Coriolis Group)
Author(s): Steven Holzner
ISBN: 1576102831
Publication Date: 08/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Drawing Rectangles

How do you draw rectangles with the shape control? You start by clicking the Shape Control tool in the Visual Basic toolbox and drawing that control to match the size and location you want your new figure to have. To draw a rectangle, you simply set the control’s Shape property to VbShapeRectangle (that’s the default anyway).

That’s all you have to do—the shape control is very easy to work with. Using the shape control, you can draw in both forms and picture boxes.

You can also set the width of the shape’s drawing line with the BorderWidth property and fill the shape using the FillColor and FillStyle properties. The BorderStyle property lets you select the style of the shape’s drawing line, including using dots and dashes.

Drawing Squares

How do you draw squares with the shape control? You start by clicking the Shape Control tool in the Visual Basic toolbox and drawing that control to match the size and location you want your new figure to have. To draw a square, you simply set the control’s Shape property to VbShapeSquare.

That’s all you have to do—the shape control is simple. Using the shape control, you can draw in both forms and picture boxes.

You can also set the width of the shape’s drawing line with the BorderWidth property and fill the shape using the FillColor and FillStyle properties. The BorderStyle property lets you select the style of the shape’s drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter.

Drawing Ovals

To draw ovals with the shape control, you start by clicking the Shape Control tool in the Visual Basic toolbox and drawing that control to match the size and location you want your new figure to have. To draw an oval, you simply set the control’s Shape property to VbShapeOval.

That’s all you have to do—the shape control is very easy. Using the shape control, you can draw in both forms and picture boxes.

You can also set the width of the shape’s drawing line with the BorderWidth property and fill the shape using the FillColor and FillStyle properties. The BorderStyle property lets you select the style of the shape’s drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter.

Drawing Circles

To draw circles, you start by clicking the Shape Control tool in the Visual Basic toolbox and drawing that control to match the size and location you want your new figure to have. To draw a circle, you simply set the control’s Shape property to VbShapeCircle.

That’s all you have to do—the shape control is very easy to work with. Using the shape control, you can draw in both forms and picture boxes.

You can also set the width of the shape’s drawing line with the BorderWidth property and fill the shape using the FillColor and FillStyle properties. The BorderStyle property lets you select the style of the shape’s drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter.

Drawing Rounded Rectangles

How do you draw rounded rectangles with the shape control? You start by clicking the Shape Control tool in the Visual Basic toolbox and drawing that control to match the size and location you want your new figure to have. To draw a rounded rectangle, you simply set the control’s Shape property to VbShapeRoundedRectangle.

That’s all you have to do—this control is very easy. Using the shape control, you can draw in both forms and picture boxes.

You can also set the width of the shape’s drawing line with the BorderWidth property, and fill the shape using the FillColor and FillStyle properties. The BorderStyle property lets you select the style of the shape’s drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter.

Drawing Rounded Squares

To draw rounded squares with the shape control, you start by clicking the Shape Control tool in the Visual Basic toolbox and drawing that control to match the size and location you want your new figure to have. To draw a rounded square, you simply set the control’s Shape property to VbShapeRoundedSquare.

That’s all you have to do. The shape control is easy. Using the shape control, you can draw in both forms and picture boxes.

You can also set the width of the shape’s drawing line with the BorderWidth property and fill the shape using the FillColor and FillStyle properties. The BorderStyle property lets you select the style of the shape’s drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter.

Setting Shape Borders: Drawing Width, Dashes, And Dots

The Aesthetic Design Department is on the line. Can’t you do something about the shapes in your program? Maybe make them—dotted? You think, dotted?

Visual Basic can help here. Just set the shape control’s BorderStyle property. Here are the possible values for the BorderStyle property:

  vbTransparent—0; transparent
  vbBSSolid—1 (the default); solid (the border is centered on the edge of the shape)
  vbBSDash—2; dash
  vbBSDot—3; dot
  vbBSDashDot—4; dash-dot
  vbBSDashDotDot—5; dash-dot-dot
  vbBSInsideSolid—6; inside solid (the outer edge of the border is the outer edge of the shape)

Using this property, you can adjust the border of your shape control as you want it.

Here’s another way to customize a shape control: you can set the shape control’s border width (in other words, the drawing line width) using the shape control’s BorderWidth property. Just set that property to the new value you want for the border thickness (the default value is 1).


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.