Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6SP5 - SetFocus to the first user control text, butt
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00790342
Message ID:
00790997
Views:
26
This message has been marked as the solution to the initial question of the thread.
This sort of thing may be of help...
LOCAL lnLoop, lnClass,lnLoopPages, lnPagesControls, lcPageControlClass, lnPages
WITH THISFORM
	FOR lnLoop = 1 TO .CONTROLCOUNT
		lcClass = UPPER(.CONTROLS[lnLoop].BASECLASS)
		IF lcClass = "TEXTBOX" THEN
			.CONTROLS[lnLoop].SETFOCUS
		ENDIF
		
		IF lcClass ="PAGEFRAME" THEN
			lnPages = .CONTROLS[lnLoop].PAGECOUNT
			FOR lnLoopPages = 1 TO lnPages
				FOR lnPagesControls = 1 TO .CONTROLS[lnLoop].PAGES[lnLoopPages].CONTROLCOUNT
					lcPageControlClass = UPPER(.CONTROLS[lnLoop].PAGES[lnLoopPages].CONTROLS[lnPagesControls].BASECLASS)
					IF lcPageControlClass == "TEXTBOX"
						.CONTROLS[lnLoop].PAGES[lnLoopPages].CONTROLS[lnPagesControls].SETFOCUS()
					ENDIF
				ENDFOR
			ENDFOR
                ENDIF
	ENDFOR
ENDWITH
but you would still probably need to set some property on the first control so that you have some way of identifying it in the controls collection.

HTH
Chris Maiden
Email
Web
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform