GetControls() ignoring TabControl and ScrollBar?

Discussion in 'Questions (Windows Mobile)' started by willisgt, Mar 14, 2008.

  1. willisgt

    willisgt Active Member Licensed User

    I've got a generic form which I want to use by creating controls dynamically and placing them on the form. When the form closes, I call GetControls( "formGeneric" ), get the list, and start disposing of controls.

    There are three controls on this form: one Label, one TabControl, and one ScrollBar. The label disposes without a problem, but in the list of controls where the names of the TabControl and the ScrollBar should be, it's just blank. A zero-length string.

    Am I missing something here?



    (I should have mentioned that I am using ControlsEX.DLL version 1.0.2995.34468.)
    Last edited: Mar 14, 2008
  2. willisgt

    willisgt Active Member Licensed User


    Attached is a minimal example of the problem.
  3. Erel

    Erel Administrator Staff Member Licensed User

    You will need to use GetControls("").
    This will return a list of all controls and objects (on all forms).
  4. agraham

    agraham Expert Licensed User

    For clarification.

    GetControls("") returns all the controls that B4PPC knows about from its' own central collection of controls.

    GetControls("someform") returns the controls from "someform"s' control collection. As only B4PPC native controls (and not all of them) have their name stored within themselves "someforms"s' control collection doesn't know the name of other types of control and so can only return a blank string.

    Your best bet is probably to keep a record of controls, and maybe their type, added to each form in a collection of some sort which you can update as you add and dispose external controls.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice