SpecialEffect, VisualEffect
The SpecialEffect property determines whether various controls have a 3-D look. For a few, it also determines the type of 3-D effect. VisualEffect, added in VFP 7, lets you raise or sink command buttons at runtime.
Usage |
oObject.SpecialEffect = nEffect nEffect = oObject.SpecialEffect |
For some objects such as page frames and Containers, the illusion used to make them look sunken and raised doesn't work very well once BorderWidth gets past 2 or 3. In particular, the color used to provide the brightening for the right and bottom edges of a sunken control or the left and top edges of a raised control is the default gray back color. You can prove this by changing the appropriate BackColor and noting that the BorderWidth is what you specified. We think a couple of shades lighter would be more effective. (We also note that, in VFP 3, this actually worked better for page frames than it does in versions 5 and later.) |
For a number of controls, when SpecialEffect is set to 2, only passing the mouse over the control raises it. The spinner remains flat when it receives focus. This is in contrast to the behavior of command buttons, which also stand out when they have focus. |
Example |
* Use a sunken page frame. This.Tabs = .F. This.SpecialEffect = 1 This.BorderWidth = 5 |
Usage |
cmdCommand.VisualEffect = nEffect |
Parameter |
Value |
Meaning |
nEffect |
0 |
Leave the button as specified by SpecialEffect. |
1 |
Give the button a raised appearance. |
|
2 |
Give the button a sunken appearance. |
Example |
* Sink a button – this might be in MouseEnter. This.VisualEffect = 2 * Set it back to normal – this might be in MouseLeave. This.VisualEffect = 0 |
See Also |
BorderColor, BorderWidth, Container, Control, MouseEnter, MouseLeave, Page, PageFrame, Tabs |