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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a formset problem

Status
Not open for further replies.

ledu

Programmer
Jul 3, 2001
24
MX
Hi all
I´d like to ask you to solve a problem I have the thing is
Im using a formset with 2 forms .
the form1 is always vislble and form2 is invisible at begining.
When I click a button in form1 the form2 is shown but the focus is not in it and work nothing.
I allready used setfocus but it didnt work.
I'll thank any help.
 
What's the code you use to activate your second form?

Dave Dardinger
 
this is what I have in button
Thisformset.form2.visible = .t.
Thisformset.form2.activate(.t.)
Thisformset.form2.gotfocus()
thisformset.form2.txtincre.setfocus(.t.)
thisformset.refresh()
 
Well, I just tried your code in a test formset and it worked as I think you want it to. When I click the button on the first form, the second one appears and the textbox gets the focus. BTW, I was unsure about the (.t.)s you have after the activate and setfocus events, since I don't think they're necessary, but VFP had no problem with them. I guess your problem must be somewhere else, like in the LostFocus event of form 1 or the gotfocus event of form 2. Make sure that there isn't a comment or even a stray space or something in one of the events which will fire which could prevent code in the parent class from firing.

Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top