aghrrr...'ControlType' problem

Byak@

Active Member
Licensed User
B4X:
gettext("Button1")

Sub gettext(name)
r=Control(name,ControlType(name)).text
Msgbox(r,"!")
End Sub

this code doesn't work!!i have error at
B4X:
Control(name,ControlType(name)).text
why??? i can't use ControlType as type of control?
 

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?
 

agraham

Expert
Licensed User
Longtime 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.
 

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?
 

Byak@

Active Member
Licensed User
amm...i want universal code for any objects...it is not real?
 

specci48

Well-Known Member
Licensed User
Longtime 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
 

Byak@

Active 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
thanks but with 'standart' controls i haven't got problems(((
 
Last edited:
Top