|
|
![]() | |
|
|
|
To access the contents, click the chapter and section titles.
Visual Basic 6 Black Book
Drawing RectanglesHow 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 controls Shape property to VbShapeRectangle (thats the default anyway). Thats all you have to dothe 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 shapes 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 shapes drawing line, including using dots and dashes. Drawing SquaresHow 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 controls Shape property to VbShapeSquare. Thats all you have to dothe 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 shapes 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 shapes drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter. Drawing OvalsTo 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 controls Shape property to VbShapeOval. Thats all you have to dothe 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 shapes 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 shapes drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter. Drawing CirclesTo 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 controls Shape property to VbShapeCircle. Thats all you have to dothe 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 shapes 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 shapes drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter. Drawing Rounded RectanglesHow 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 controls Shape property to VbShapeRoundedRectangle. Thats all you have to dothis 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 shapes 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 shapes drawing line, including using dots and dashes. For more on this control, see the other topics in this chapter. Drawing Rounded SquaresTo 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 controls Shape property to VbShapeRoundedSquare. Thats 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 shapes 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 shapes 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 DotsThe Aesthetic Design Department is on the line. Cant you do something about the shapes in your program? Maybe make themdotted? You think, dotted? Visual Basic can help here. Just set the shape controls BorderStyle property. Here are the possible values for the BorderStyle property:
Using this property, you can adjust the border of your shape control as you want it. Heres another way to customize a shape control: you can set the shape controls border width (in other words, the drawing line width) using the shape controls BorderWidth property. Just set that property to the new value you want for the border thickness (the default value is 1).
|
|
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. |