Sliding and Fading Transitions

Team Fly 

Page 636

         Dim lgBrush As New LinearGradientBrush( _           New Point(1, 1), New Point(x, y), _           Color.White, Color.FromArgb(190, 190, 190))         g.FillRectangle(lgBrush, 0, 0, x, y) 

Notice the adjustments, in boldface (–3 and so on), that permit the button's frame to show. You want to put the gradient only on the button surface, not cover up the shading around its edges.

TIP You may want to add additional special effects to your forms, such as custom buttons (perhaps round), lights that dim and fade, drop shadowing, neon, 3D, animation, sculpted labels, and other effects. Use graphics programs to create these effects, then import them into the form's and controls' BackgroundImage or Image properties. Use a Timer, for example, to occasionally display a reflection like those in Figure 21.10, then hide it by setting the PictureBox containing it toVisible = False.

image

FIGURE 21.10 Using a variety of different gradient effects add solidity and sophistication to your applications. Notice that the background on this form is, itself, a gradient.

Sliding and Fading Transitions

Applications with multiple forms benefit from animated transitions. Just as it can be annoying if a movie jumps abruptly from one scene to another—simply slapping a new scene on top of the current one—so too will your projects look more professional if there's a visual transition between your forms.

When a user clicks a button to bring up Form2, you can slide it over from the side, or down from the top, like a garage door. Or you can use the classic fade: the new form gradually appears as if from out of the mist, replacing the current form.

In the past, computer video was too slow for fades (though it could cope with slides). Also, there was no built-in facility for adjusting opacity as there is now, the form's Opacity property (alas, there's no such property yet for individual controls—they all fade along with their parent form).

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net