Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set focus on first contrl
Message
From
25/07/1999 19:56:13
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Set focus on first contrl
Miscellaneous
Thread ID:
00245917
Message ID:
00245917
Views:
49
In following code I need to guarantee the focus goes to the first readable control. I don't know the Tabindex of the first control because depends of the form, and this code is inside class and not always the first control is readable or has the property tabindex.

In my case (after instantiate the form class)
the first control is a textbox readonly=.f., tabindex=1,
the second control is a textbox readonly= .t., tabindex=2,
the third control is a combobox readonly=.t., tabindex=3

FOR EACH oCont IN Thisform.Controls
IF oCont.Baseclass = 'Pageframe'
FOR EACH Ctrl IN oCont.Page1.Controls
IF PEMSTATUS(Ctrl,'TabIndex',5) = .T. AND ;
PEMSTATUS(Ctrl,'Readonly',5) = .T. AND ;
Ctrl.Readonly = .F.
Ctrl.SetFocus()
EXIT
ENDIF
ENDFOR
EXIT
ENDIF
ENDFOR

What is happening is that instead the focus goes to the second control (tabindex=2) is going to third (tabindex=3). What is wrong?
Antonio Carlos Kleinübing
Systems Analyst
Next
Reply
Map
View

Click here to load this message in the networking platform