Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: ZOrder change the Controls Index of the control !
Message
From
31/05/2004 13:52:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
BUG: ZOrder change the Controls Index of the control !
Miscellaneous
Thread ID:
00908708
Message ID:
00908708
Views:
39
If you use ZOrder methods for a control X, with controls index XIndex,:
X.Parent.Controls[m.XIndex]=X
the result is that the XIndex change to 1 or to ControlCount:
X.Zorder(0) && -> m.XIndex = X.Parent.ControlCount

X.Zorder(1) && -> m.XIndex = 1
and all other controls index roll up or down.

Then, controls index true meant is Zindex !

You cannot to use ZOrder and controls[] for reference to a specific control.

Repro:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 101, ;
		Top = 45, ;
		Width = 100, ;
		Name = "Text1"

	ADD OBJECT label1 AS label WITH ;
		Caption = "Label1", ;
		Height = 23, ;
		Left = 101, ;
		Top = 45, ;
		Width = 100, ;
		Name = "Label1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 17, ;
		Left = 260, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "top Text", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 51, ;
		Left = 261, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "top Label", ;
		Name = "Command2"

	PROCEDURE command1.Click
		ThisForm.Text1.ZOrder
		MESSAGEBOX(thisForm.Controls[4].Name,0,"controls[4] is")
	ENDPROC


	PROCEDURE command2.Click
		ThisForm.Label1.ZOrder
		MESSAGEBOX(thisForm.Controls[4].Name,0,"controls[4] is")
	ENDPROC

ENDDEFINE
Today i have lost the control index.

Fabio
Next
Reply
Map
View

Click here to load this message in the networking platform