> Hello,
> I am having difficulty in setting focus on the control I need.
>
> Here is the situatuion.
>
> On my form, I have a textbox that accepts only scans and a button. The button is not enabled until the scan happens.
> There are no keyboard or mouse - just a barcode scanner and a touch screen.
>
> The button should only appear after the barcode is scanned and verified. At this point my barcode is saved and the textbox is cleared. Button only should serve as an available option.
>
> My problem is to return the focus to the textbox and not have it on the button at all.
>
> I am trying to use Control.SetFocus but it doesn't work...
>
> Thank you for your help.
when you say "Control.SetFocus" what do you mean? There is no such command in VFP. If the code is IN the same control, then you would use "This.SetFocus()" otherwise you must use the properly qualified object reference - Something like:
ThisForm.pgfMain.pagEntry.cntControls.txtData.SetFocus()
Basically you need to specify the full unambiguous path to find the object whose PEM you need to access.
Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA