Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabled page gets focus in exe but not in the interpret
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00082929
Message ID:
00083132
Views:
21
>I have got following problem, has anybody else notised it.
>
>Our's application uses heavily pageframes and we have inserted
>new pages between old ones in one of our forms. Depending
>about situation some pages are disabled. Now everything works
>great in the interpreter but in the 'compiled' exe users are
>able to move in to disabled pages by first clicking enabled
>page's tab and pressing left or right arrow. In interpreter
>focus sifts to next enabled page.
>
>thanks

I had this problem as well - it is a known bug (feature) in VFP 5.00, I picked up this workaround in Advisor I believe. It works great, I put it in my main forms class in the KEYPRESS EVENT.
* 5.0 workaround -- if page is disabled,
* 5.0 lets users keyboard to it, paints it,
* and then won't activate.  Skip to the next enabled page.
*
* FORM'S KeyPreview PROPERTY MUST BE SET .T.

LOCAL nLeft, nRight
nLeft = 19
nRight = 4

IF nShiftAltCtrl = 0 AND INLIST(nKeyCode,nLeft, nRight) ;
		AND TYPE("THIS.activecontrol.pageOrder") = "N"
	LOCAL nNextPage, lFound
	WITH THIS.activecontrol.parent
		nNextPage = .activepage
		* Find next enabled Page
		DO WHILE !lFound
			nNextPage = nNextPage + IIF(nKeyCode = nLeft, -1, 1)
			IF nNextPage < 1
				nNextPage = .PageCount
			ELSE
				IF nNextPage > .PageCount
					nNextPage = 1
				ENDIF
			ENDIF
			IF .Pages(nNextPage).Enabled
				.activepage = nNextPage 
				NODEFAULT
				EXIT
			ENDIF
		ENDDO
	ENDWITH
ENDIF
Ernest
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform