19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

THE SHAPE CONTROL<br />

The shape control assumes one of six possible predefined shapes depending on the value of<br />

its Shape property. Figure 10-5 shows the six shapes <strong>and</strong> the values of their corresponding<br />

Shape properties. Shapes are usually placed on a form at design time for decoration or to highlight<br />

certain parts of the form. By convention, names of shape controls have the prefix shp.<br />

FIGURE 10-5 The Six Possible Shapes for a Shape Control<br />

The most useful properties of shapes are BackStyle (transparent vs. opaque; see<br />

Figure 10-6), BorderWidth (thickness of border), BorderStyle (solid, dashed, dotted, etc.),<br />

BackColor (background color), FillStyle (fill-in pattern: horizontal lines, upward diagonal<br />

lines, etc., as in Figure 9.20), FillColor (color used by FillStyle), <strong>and</strong> Visible.<br />

FIGURE 10-6 Effect of the Value of the BackStyle Property<br />

Nine Elementary Controls 301<br />

Figure 10-7 shows several effects that can be achieved with shapes. In the first effect, a<br />

comm<strong>and</strong> button is set off by placing it on top of a rounded rectangle shape whose BackStyle<br />

is opaque, BackColor is blue, FillStyle is downward diagonal, <strong>and</strong> FillColor is yellow. In the<br />

second effect, the TRFFC20.ICO icon (displayed in an appropriately sized, borderless picture<br />

box) is “framed” by placing it on top of an oval shape whose BackStyle is opaque <strong>and</strong> Back-<br />

Color is the same as the background color of the icon. In the last effect, two comm<strong>and</strong> buttons<br />

are tied together by surrounding them with a circle shape whose FillStyle is transparent,<br />

BorderWidth is 8, <strong>and</strong> BorderColor is green, <strong>and</strong> by placing behind the comm<strong>and</strong> buttons an<br />

oval shape whose FillStyle is transparent, BorderWidth is 3, <strong>and</strong> BorderColor is blue.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!