Discussion in 'Questions (Windows Mobile)' started by magi6162, Aug 24, 2007.
how to know the parent of a control to runtime?
thanks for help
Why do you need that?
Since the parent of a control cannot be changed at runtime, the parent is always known. So you can implement everything during design time.
An undocumented feature of the formlib...
Because I browsed through the help files and there is no hint of a changeParent function :sign0161:
Well, after all I don't think you can't get the parent of a control by runtime.
Maybe Erel can add this feature to the formlib (and make a small comletion to the help file, too ... )
the function is documented
You are both right.
The FormLib help file distributed with version 5.50 doesn't include it (by mistake).
It appears here: http://www.basic4ppc.com/help/formlib/index.html
Now that's settled back to the original question
Apparently you don't need this information to use ChangeParent, you only need to know the name of the new parent.
I don't use in changeparent.
I create controls to runtime and after i use un for.. next and i need to know the parent.
Otherwise I make in other way, plus complicated
sorry, my bad english
If you create the controls at run time then you must be specifying the parent then, so you could keep track of the controls and their current parent in a 2-dimensional array. Alternatively you could keep the controls in an ArrayList to use its in-built searching (IndexOf) and keep the current parent in another array at the same index.
Ok,plus complicated, but the same one goes well