Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Workaround for a bug
Message
From
14/06/2001 16:10:00
 
 
To
14/06/2001 15:23:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00519598
Message ID:
00519716
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>>I have only tested this code for the conditions in it. There may be other factors that prevent a control from receiving focus, like visible property.
local loMinControl
loMinControl = .null.
for each loControl in ThisForm.Controls
   if isnull(loMinControl)
      if upper(loControl.BaseClass) <> "GRID" and pemstatus(loControl, 'SetFocus', 5) and loControl.Enabled
         loMinControl = loControl
      endif
      loop
   endif
   if upper(loControl.BaseClass) <> "GRID" and pemstatus(loControl, 'SetFocus', 5) and loControl.Enabled
      if loControl.TabIndex < loMinControl.TabIndex
         loMinControl = loControl
      endif
   endif
endfor
<b>thisForm.oMinControl = loMinControl</b>
>
>That works.

Or, you can add a property to your form. Run this code one time in form.init(), and when you need to setFocus you can issue thisForm.oMinControl.setFocus().
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform