Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Focus in optiongroup
Message
 
 
To
15/05/1999 11:51:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00219336
Message ID:
00219349
Views:
16
Dragan,

In the first opt put this code in the .GotFocus()
with this.parent
   .Buttons[ .Value ].SetFocus()
endwith
this assumes the buttons are in order and you've left the value as numeric. If that's not true you might have to use the TabIndex to find the correct control.

>I'm having heavy-duty hands-down data entry form, with a bunch of optiongroups. The optiongroups may have any number of optionbuttons, from two to nine. The reason I've put the bold on "entry" is that I want the group to be capable of handling the Enter key as if it were a textbox, i.e. "accept the value already there and lose focus". The trouble is that when the optiongroup receives the focus, the focus lands on Option1, whichthe selected button is Option1, even though the group's value is 5 and the selected button should be Option5. If I press Enter, the value will get to be 1 and not 5.
>
>Unfortunately, the optiongroup has no GotFocus event; I've added a SetFocus event, but it fires only when I tell it.
>I've tried to do something with the GotFocus of Option1 (there's only one button in the class definition - the others are added during optiongroup.init) - to setfocus to the button which should have it, but then it interfered with the click of the button itself etc etc.
>
>Is there any better way to have the focus land on the button which corresponds to the actual value of the group, as soon as the group gets the focus (even though it doesn't have a GotFocus)?
df (was a 10 time MVP)

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

Click here to load this message in the networking platform