Control and Parent

Discussion in 'Questions (Windows Mobile)' started by magi6162, Aug 24, 2007.

  1. magi6162

    magi6162 Active Member Licensed User

    hi,
    how to know the parent of a control to runtime?

    thanks for help
     
  2. specci48

    specci48 Well-Known Member Licensed User

    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.

    specci48
     
  3. magi6162

    magi6162 Active Member Licensed User

    using FormLib->ChangeParent.
     
  4. specci48

    specci48 Well-Known Member Licensed User

    :signOops:
    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 ... ;))


    specci48
     
  5. magi6162

    magi6162 Active Member Licensed User

    the function is documented
     
  6. agraham

    agraham Expert Licensed User

    Where?
     
  7. Erel

    Erel Administrator Staff Member Licensed User

  8. agraham

    agraham Expert Licensed User

    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.
     
  9. magi6162

    magi6162 Active Member Licensed User

    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

    magi6162
     
  10. agraham

    agraham Expert Licensed User

    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.
     
  11. magi6162

    magi6162 Active Member Licensed User

    Ok,plus complicated, but the same one goes well

    magi6162
     
Loading...