Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prev Next page command button and disabled pages
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00956952
Message ID:
00957016
Views:
14
Hi Terry and Jon

Thanks for the code. I have adapted Terry's logic as follows (hopefully made it more readable <g>)

NextButton.Click()
DODEFAULT()

THISFORM.pgf.ACTIVEPAGE = THISFORM.GetNextPageNo()

THISFORM.PrevNextCaption()
PreviousButton.Click()
DODEFAULT()

THISFORM.pgf.ACTIVEPAGE = THISFORM.GetPreviousPageNo()

THISFORM.PrevNextCaption()
Form.PrevNextCaption()
IF TYPE("THISFORM.cmdPrevious.CAPTION") # "C"
	RETURN
ENDIF

WITH THISFORM
	.cmdPrevious.CAPTION = "<< " + .pgf.PAGES(.GetPreviousPageNo()).CAPTION
	.cmdNext.CAPTION     = .pgf.PAGES(.GetNextPageNo()).CAPTION + " >>"
ENDWITH
Form.GetNextPageNo()
LOCAL lnActPage, lnLastPage, lnNextPage

WITH THISFORM
	lnActPage  = .pgf.ACTIVEPAGE
	lnLastPage = .pgf.PAGECOUNT

	DO WHILE .T.
		lnNextPage = lnActPage + 1              && Nominally "active" page but not necessarily active
		
		IF lnNextPage > lnLastPage
			lnNextPage = 1
		ENDIF
		
		IF NOT .pgf.PAGES( lnNextPage).ENABLED  && If chosen page not enabled
			lnActPage = lnNextPage
		ELSE
			EXIT        						&& SUCCESS!!!
		ENDIF
	ENDDO
ENDWITH

RETURN lnNextPage
Form.GetPreviousPageNo()
LOCAL lnActPage, lnLastPage, lnNextPage

WITH THISFORM
	lnActPage  = .pgf.ACTIVEPAGE
	lnLastPage = .pgf.PAGECOUNT

	DO WHILE .T.
		lnNextPage = lnActPage - 1              && Nominally "active" page but not necessarily active
		
		IF lnNextPage < 1
			lnNextPage = lnLastPage
		ENDIF
		
		IF NOT .pgf.PAGES( lnNextPage).ENABLED  && If chosen page not enabled
			lnActPage = lnNextPage
		ELSE
			EXIT								&& SUCCESS!!!
		ENDIF
	ENDDO
ENDWITH

RETURN lnNextPage
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform