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.

BackStyle

Peek-a-boo! I see you.
Traditional Children’s Game

This property determines whether or not you can see through controls. The default is 1 for Opaque, meaning that the control hides whatever’s behind it.

Usage

oObject.BackStyle = nBackStyle
nBackStyle = oObject.BackStyle

Parameter

Value

Meaning

nBackStyle

0

The object is Transparent, meaning that whatever's behind it on the form is visible.

1

The object is Opaque, meaning that whatever's behind it on the form is hidden.

Several controls, including lists and combo boxes, don’t have a BackStyle property and always hide things behind them.

In an OptionGroup, there’s a BackStyle property for the group as a whole, plus individual BackStyles for the buttons in the group. You can actually create some pretty cool effects this way. (Imagine alternating Transparent and Opaque for the option buttons in the group.)

The help says (correctly) that BackStyle is read-only for Pages in a Page frame where Tabs is set to .T. What it doesn't say is that you can set the Page frame's Tabs property to .F., set the Pages to Transparent, then set Tabs to .T., and voila, you've got transparent tabbed pages. We hope this isn't considered a bug because the Transparent page frame looks pretty cool (though some of the 3-D effects are a little strange). Even though the pages let the form's BackColor show through, stuff from the individual pages is kept segregated.

Example

* Make all labels on current form transparent
_Screen.ActiveForm.SetAll("BackStyle", 0, "Label")

See Also

BackColor, FillColor, ForeColor, Tabs