Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

AlwaysOnBottom

This property lets you create forms that insist on staying underneath everything else.

Usage

frmForm.AlwaysOnBottom = lBottomDweller
lBottomDweller = frmForm.AlwaysOnBottom

Our initial reaction to this property was “Why the heck would you want to do that?” But a conversation with a member of the Microsoft VFP team, followed by an incredible demo at the 1998 FoxPro DevCon from super-guru Ken Levy, drove the point home. What this property lets you do is replace the VFP desktop with your own custom desktop, one with all the capabilities of a form. Ken’s demonstration used a form with the Web Browser control on it, so inside VFP, while running other forms, he could navigate to Web sites, keep up-to-date on the weather, download files, and so forth. We’re not at all sure we’d want to run our development environment that way, but we get it.

AlwaysOnBottom is also useful in an ActiveDoc environment, where it lets you set up the background for your application. We suspect that was the original intention of adding this property, but like many things Fox, it may find uses far beyond its original design.

We’re pleased to find that this property behaves fairly sensibly (not to mention as documented). For example, if you turn on both AlwaysOnTop and AlwaysOnBottom, VFP is smart enough to ignore you and only keep the form on top.

Example

* If this window is in the background, add a label
IF This.AlwaysOnBottom
   This.AddObject("lblInfo","label")
   This.lblInfo.AutoSize = .T.
   This.lblInfo.Top = 50
   This.lblInfo.Caption = "I'm right behind you"
   This.lblInfo.FontSize = 20
   This.lblInfo.Visible = .T.
ENDIF

See Also

ActiveDoc, AlwaysOnTop, Form