X.Parent.Controls[m.XIndex]=Xthe result is that the XIndex change to 1 or to ControlCount:
X.Zorder(0) && -> m.XIndex = X.Parent.ControlCount X.Zorder(1) && -> m.XIndex = 1and all other controls index roll up or down.
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 ENDDEFINEToday i have lost the control index.