>>>>>FORM1
>>>>>--------------------------------------------------------------
>>>>>() Opt1 TextBox1
>>>>>() Opt2 TextBox2
>>>>>
>>>>>CommandButton1 CommandButton2
>>>>>--------------------------------------------------------------
>>>>>Opt1.click event
>>>>> thisform.textbox1.setfocus
>>>>>
>>>>>Opt2.click event
>>>>> thisform.textbox2.setfocus
>>>>>
>>>>> When I Click (SpaceBar) to select Opt1, focus goes to TextBox1 which is as I expect. Also behaves properly for Click(SpaceBar) to select Opt2.
>>>>>
>>>>>PROBLEM: When I press ENTER to select either Opt1 or Opt2 the appropriate Opt?.Click fires, but focus is set to CommandButton1.
>>>>>
>>>>>Is there a way around this????
>>>>
>>>>what do you have in the option group click event?
>>>>i think the problem is that you're selecting the entire control when you click on it w/ the mouse. because the control didn't have focus, it doesn't process either option click event. once the control has focus, clicking on either one will give the desired result.
>>>
>>>
>>>I do have the focus set to opt1 in optiongroup...
>>>FYI..TextBox1 and TextBox2 are disabled until I select Opt1 or Opt2
>>>then I enable and then setfocus to the appropriate textbox in the Click Method of the option selected. I also verified that it does run the controls click event when I click an option because I put a Suspend to trace the code in each Option Click Event.
>>>
>>>I hope this helps?
>
>
>Move your code to the optiongroup.click() && the container
>And try this:
>
>do case
>case this.value = 1 && option1
>thisform.textbox1.setfocus()
>case this.value = 2 && option2
>thisform.textbox2.setfocus
>endcase
>
>Dont forget to remove all code in option.click() because this code will override the code in the optiongroup.click().
Still have the same problem????????? I did mention that I am using VFP 5.0???
While Tracing Code, When I use Enter or Click Option1, fires optiongroup.click ...
Case this.value =1
thisform.textbox1.setfocus()
after I run that line, the cursor is at textbox 1
BUT, When I Resume
IF Clicked on Option---TextBox1 has control
IF Enterd on Option---TextBox2 has control
Thanks,
Kris
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only