Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PAges in a pageframe
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00175008
Message ID:
00175114
Vues:
34
Hi Claude,

>Is there a quick way to jump to another page of a pageframe in the form designer of vfp5.

If you pageframe doesn't contain page tabs, the following tool works most of the time. The pageframe must be in edit mode (rightclick and choose Edit). This program displays all pages of the currently selected pageframe in a list and activates the dersired page in the designer:
Local loGoPage
loGoPage = CreateObject("frmGoPage")
If Type("m.loGoPage") == "O"
	loGoPage.Show(1)
Endif

Define Class frmGoPage as Form
	Width = 150
	Height = 100
	Controlbox = .F.
	AutoCenter = .T.
	Caption = "Go to page"
	oPageframe = NULL
	Dimension aPages[1]
	Add Object lstPages as lstGoPage
	Procedure Init
		Local loRef
		loRef = Sys(1270)
		Do While Type("loRef.Parent") == "O"
			If loRef.BaseClass == "Pageframe"
				This.oPageframe = m.loRef
				Exit
			Endif
			loRef = loRef.Parent
		Enddo
		If IsNull(This.oPageframe)
			Return .F.
		Endif
		AMembers(This.aPages,This.oPageframe,2)
		This.lstPages.RowSource = "Thisform.aPages"
		This.lstPages.RowSourceType = 5
		This.lstPages.Requery
		This.lstPages.ListIndex = 1
	EndProc
Enddefine

Define Class lstGoPage as Listbox
	Width = 150
	Height = 100
	Procedure DblClick
		This.Go
	EndProc
	Procedure KeyPress(tnKeyCode,tnFlags)
		If m.tnKeyCode==13
			This.Go
		Endif
		If m.tnKeyCode = 27
			Thisform.Release
		Endif
	EndProc
	Procedure Go
		Local lcPage, llTabs
		lcPage = This.Value
		llTabs = Thisform.oPageframe.Tabs
		Thisform.oPageframe.Tabs = .T.
		Thisform.oPageframe.&lcPage..SetFocus
		If not m.llTabs
			Thisform.oPageframe.Tabs = .F.
		Endif
		Thisform.Release
	Endproc
Enddefine
Christof
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform