Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Westminster Circle, Akron
 Ohio - United States
 Andy Kramek
 To: Alex Gefter
  Where is Alex Gefter?
 Detroit
 Michigan - United States
 Alex Gefter
 Tags
Subject: RE: Set Focus
Thread ID: 232008 Message ID: 232010 # Views: 46 # Ratings: 1
Version: Visual FoxPro 7 Category: General VFP Topics
Date: Thursday, June 18, 2009 11:13:21 PM         
   


> 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



COMPLETE THREAD
Set Focus Posted by Alex Gefter @ 6/18/2009 9:35:35 PM
RE: Set Focus Posted by Cetin Basoz @ 6/18/2009 9:57:42 PM
RE: Set Focus Posted by Andy Kramek @ 6/18/2009 11:13:21 PM
RE: Set Focus Posted by Ammar Hadi @ 6/19/2009 2:35:15 AM
RE: Set Focus Posted by Yousfi Benameur @ 6/19/2009 11:04:34 AM