Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Focus to an Option Button

Status
Not open for further replies.

JBalcerzak

Programmer
Sep 5, 2002
73
US
I've got a control array of 4 option buttons contained in a frame on a form. After the user enters some stuff, I want to be able to reset the form to the state the user started with, and I get everything reset except for setting the focus to the starting option button. I'm a VFP and VC++ programmer so this stuff is a little new to me. I've got the following code

optColors(0).SetFocus()

And I keep getting a run-time error on it. I'm wondering if I'm not referencing this properly? Any ideas would be greatly appreciated.
 
Great thanks - I'll give that a try. I'm using my C++ syntax here I guess.
 
Figured it out - I was getting the error because I was in the Form_init method. Once I created a seperate method to reset my data and reset the focus, everything worked fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top