>>>I would like to be in the textbox before I had switch to another program. Which command i must use. Example, suppose I work in program A textbox 5 and I open another program (Program B). After I close program B , I would like the cursor appear in textbox5 in program A .
>>> Thank for your help
>>>From No
>
>I mean I have set color in every Textbox.gotfocus. So, I cannot specific which textbox I am in use before switch to program B. And after I close program B, I would like the textbox in program A appear the color which I have set in textbox.gotfocus. So, for this reason , I cannot call textbox.setfocus after program B closed.
I still couldn't understand what you mean. I'll try to shoot in the dark.
-You set backcolor in gotfocus and reset in lostfocus. On return from formB you want again only the textbox with focus have different color (I think this is a miss shot). If so gotfocus+lostfocus code is sufficient and would do the job.
this.backcolor = rgb(255,255,0)
this.resettodefault("BackColor")
-On return from formB you want to be on a particular control - ie: text5. If so, although many ways for that, here is just one :
do form formB with thisform
lparameters oCaller
this.oCaller = oCaller
this.oCaller.text5.setfocus()
Cetin