[Gambas-user] How to get the controltypes in a form

Benoît Minisini gambas at ...1...
Thu Oct 27 16:28:19 CEST 2011


Le 27/10/2011 15:50, J_Mischk3 a écrit :
>
> My idea is to scan a container(form) with several fields ( button, textarea,
> text and so on ) and if i can get the class of a Control, i can use special
> automated functions to put data from a database into it.
>
> Example: if Value in DB is 1, akticate Button
>
> But HOW is it possible to get this.
> EXAMPLE:
> ' Gambas class file
>
> Public Sub Form_Open()
>          Dim C As Control
>          For Each C In Me.Children
>                  Print "C = "; C
>          Next
> End
>
> And I get
> C = (Label 0x8f7ccf4)
> C = (TextBox 0x8f7d8cc)
> C = (ToolButton 0x8f8213c)
> C = (Button 0x8f8ed44)
>
> This is the information I need, but you can I get directly? ( "Label",
> "Textbox", "MyOwnControlTyp" )  I found Control.Name and much more, but no
> Control.Typename
>

To manipulate object type system, use the static methods of the Object 
class.

To get the type of a object:

Object.Class() or Object.Type(), depending on what you need.

See the documentation for more details.

Regards,

-- 
Benoît Minisini




More information about the User mailing list