Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optiongroup visibility
Message
 
 
To
03/02/2002 11:22:25
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00614552
Message ID:
00614586
Views:
19
Jere,

>is there any way to highlight (border color, background color, or anything) an optiongroup when it's in focus so that it's easier to see ?

It isn't pretty code because the opg doesn't have a GotFocus()/LostFocus() events. To get the Border to change colors:

Set SpecialEffect = 1 - Plain

In the When()
this.BorderColor = 255
return dodefault()
In the Valid():
* since Valid() fires during mouse clicks
* only change the color if the mouse is down over the top
* of another control
if ( ! ( mdown() and ( sys( 1272, this ) $ sys( 1272, sys( 1270 ) ) ) ) )
   this.BorderColor = 0
endif

return dodefault()
Then in each OptionButton.LostFocus() you need:
this.parent.Valid()
return dodefault()
If you want to do this globally for all your opg controls it's a real annoying to copy that LostFocus() code everywhere. Since you can't visually subclass the OptionButton class itself you can use code in your opg.Init() that can switch out the buttons with your own .prg based subclass buttons. I know that I've posted the code required to do this here in the past, but I can't easily search for it right now.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform