Changes a control parent.
Using ChangeParent you can move a control from one form to another.
Syntax: ChangeParent (Control As Control, Parent As Control)
Control - The name of the control that will be moved.
Parent - The new parent for the control.
Example:
Sub App_Start
Form1.Show
flb.New1("form1",b4pobject(1))
flb.ChangeParent("Button2","Form2") 'Moves Button2 to Form2.
End Sub
You must:
- load the FormLib library
- Add a FormLib object for example flb
- declare the the flb FormLib object with flb.New1("Form1",B4PObject(1)) - Add somewhere in your, depending on how and when you want to move the panel with. flb.ChangeParent("Panel1","Form2")
Attached a very small example, it shows you that you can move a panel from Form1 to Form2 and also backwards.
I have a problem, when the panel is moved, it is at background of all controls of the destiny form. I try panel.bringToFront but has no effect.
I want the moved panel is in foreground
In your example try to add a buttonX in the form2, when you move the panel, the buttonX appears on top of the panel's button.