Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use a container across multiple pages in pagefram
Message
From
14/05/2005 08:19:05
 
 
To
13/05/2005 08:41:39
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01013681
Message ID:
01014191
Views:
29
This message has been marked as the solution to the initial question of the thread.
Here is an entire form with this implementation:
**************************************************
*-- Form:         form1 (c:\dev\vdev\val\val5\demo.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   05/14/05 08:17:05 AM
*
DEFINE CLASS form1 AS form


	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT pageframe1 AS pageframe WITH ;
		ErasePage = .T., ;
		PageCount = 2, ;
		Top = 13, ;
		Left = 14, ;
		Width = 359, ;
		Height = 239, ;
		Name = "Pageframe1", ;
		Page1.Caption = "Page1", ;
		Page1.Name = "Page1", ;
		Page2.Caption = "Page2", ;
		Page2.Name = "Page2"


	ADD OBJECT form1.pageframe1.page1.text1 AS textbox WITH ;
		Height = 27, ;
		Left = 27, ;
		Top = 37, ;
		Width = 57, ;
		Name = "Text1"


	ADD OBJECT form1.pageframe1.page1.text2 AS textbox WITH ;
		Height = 27, ;
		Left = 77, ;
		Top = 103, ;
		Width = 57, ;
		Name = "Text2"


	ADD OBJECT form1.pageframe1.page1.text3 AS textbox WITH ;
		Height = 27, ;
		Left = 131, ;
		Top = 33, ;
		Width = 57, ;
		Name = "Text3"


	ADD OBJECT form1.pageframe1.page1.text4 AS textbox WITH ;
		Height = 27, ;
		Left = 231, ;
		Top = 119, ;
		Width = 57, ;
		Name = "Text4"


	ADD OBJECT form1.pageframe1.page2.text1 AS textbox WITH ;
		Height = 27, ;
		Left = 35, ;
		Top = 45, ;
		Width = 57, ;
		Name = "Text1"


	ADD OBJECT form1.pageframe1.page2.text2 AS textbox WITH ;
		Height = 27, ;
		Left = 123, ;
		Top = 49, ;
		Width = 57, ;
		Name = "Text2"


	ADD OBJECT form1.pageframe1.page2.text3 AS textbox WITH ;
		Height = 27, ;
		Left = 205, ;
		Top = 53, ;
		Width = 57, ;
		Name = "Text3"


	ADD OBJECT container1 AS container WITH ;
		Top = 208, ;
		Left = 17, ;
		Width = 349, ;
		Height = 31, ;
		BackStyle = 0, ;
		BorderWidth = 0, ;
		Name = "Container1"


	ADD OBJECT form1.container1.command1 AS commandbutton WITH ;
		Top = 8, ;
		Left = 30, ;
		Height = 17, ;
		Width = 59, ;
		Caption = "Command1", ;
		Name = "Command1"


	ADD OBJECT form1.container1.command2 AS commandbutton WITH ;
		Top = 8, ;
		Left = 122, ;
		Height = 17, ;
		Width = 59, ;
		Caption = "Command1", ;
		Name = "Command2"


	PROCEDURE tabhandler
		IF INLIST(LASTKEY(),9,13)	&& Only interested in TAB and CR
			this.container1.command1.SetFocus()
		ENDIF 


	ENDPROC


	PROCEDURE Init
		Local oPage As Page, HiTab, HiControl As TextBox, oControl as textbox

		This.pageframe1.ZOrder(1)
		This.container1.ZOrder(0)

		With This.pageframe1
		  For Each oPage In .Pages
		    HiTab = 0
		    HiControl = ''
		    For Each oControl In oPage.Controls
		      If Pemstatus(oControl,'Lostfocus',5)
		        If oControl.TabIndex > HiTab
		          HiTab = oControl.TabIndex 
		          HiControl = oControl
		        Endif
		      Endif
		    Endfor
		    If Not Empty(HiTab)
		      Bindevent(HiControl,'lostfocus',This,'tabhandler',7)
		    Endif
		  Endfor
		ENDWITH
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
>Hi Glenn,
>
>> Add this container to the FORM and set it's zorder to 0 (Bring to Front) over the pageframe. It then would exist only once but appear on each page.
>
>Thanks for sharing that technique. For those following this thread, Glenn's technique does work. Unfortunately, its difficult to control how this container fits into the control tab order (TabIndex sequence) when it's brought to the forefront like this.
>
>Malcolm
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform