aghrrr...'ControlType' problem

Discussion in 'Questions (Windows Mobile)' started by Byak@, Mar 24, 2009.

  1. Byak@

    Byak@ Active Member Licensed User

    Code:
    gettext("Button1")

    Sub gettext(name)
    r=
    Control(name,ControlType(name)).text
    Msgbox(r,"!")
    End Sub
    this code doesn't work!!i have error at
    Code:
    Control(name,ControlType(name)).text
    why??? i can't use ControlType as type of control?
     
  2. Byak@

    Byak@ Active Member Licensed User

    for standart controls i can use
    Code:
    gettext("Button1")

    Sub gettext(name)
    obj.New1(False)
    obj.FromControl(name)
    r=obj.GetProperty("Text")
    Msgbox(r,"!")
    End Sub
    'obj' is door object.but how can i use it for controls from other dlls?
     
  3. agraham

    agraham Expert Licensed User

    The library needs to return a reference to the control, usually by either ControlRef or Value. Then you use

    obj.Value = LibraryControl.ControlRef

    or

    obj.Value = LibraryControl.Value

    If the library does not expose a reference then you could use obj.FromLibrary(....) but you would need to know the internal name of the control in the library which you could possibly get using .NET Reflector.
     
  4. Byak@

    Byak@ Active Member Licensed User

    thanks Agraham but i don't understand...
    'LibraryControl' what it is?
    please,can you modifi my cod with this metod?
     
  5. agraham

    agraham Expert Licensed User

    It is a placeholder for the name of the library control. I can't modify your code as I don't know what controls you are talking about nor their names.
     
  6. Byak@

    Byak@ Active Member Licensed User

    amm...i want universal code for any objects...it is not real?
     
  7. specci48

    specci48 Well-Known Member Licensed User

    Hello Byak@,

    I think you are looking for something like this (see attachment; needs the door.dll).
    This solution works for every "standard" control supporting the text property.


    specci48
     
  8. Byak@

    Byak@ Active Member Licensed User

    thanks but with 'standart' controls i haven't got problems(((
     
    Last edited: Mar 24, 2009
  9. agraham

    agraham Expert Licensed User

Loading...
  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