TRANSPARENCY

The Form object provides a couple of properties that you can use to make a form partially transparent. Opacity determines the form’s opaqueness. At design time, the Properties window shows Opacity as a percentage where 100 percent means the form is completely opaque, and 0 percent means that the form is completely transparent. At run time, your program must treat Opacity as a floating-point value between 0 (completely transparent) and 1 (completely opaque).

A program can use an Opacity value less than 100 percent to let the user see what lies below the form. For example, you might build a partially transparent Search dialog box so the user could see the underlying document as a search progresses.

If Opacity is greater than 0 percent, the form behaves normally aside from its ghostlike appearance. The user can click it, interact with its controls, minimize and maximize it, and grab its borders to resize it.

If Opacity is 0 percent, the form is completely transparent and the user can interact with the form only through the keyboard. For example, the user can press the Tab key to move between the form’s controls, type text, press the Spacebar to invoke a button that has the focus, and press Enter or Esc to fire the form’s Accept and Cancel buttons; however, the form and its controls will not detect mouse clicks. The user also cannot see the form (obviously), so figuring out which control has the focus can be next to impossible.

TOO MUCH TRANSLUCENCY
Most applications ...

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.