[Gambas-user] Sending parms to workspace children

Benoît Minisini gambas at ...1...
Wed Jun 11 16:27:11 CEST 2014


Le 11/06/2014 15:53, Roel Touwen a écrit :
> Hi Benoit,
>
> Can you give me a sample? I tried: (Also tried to DIM as Window and
> tried Dim.. as new) But I still get an error on the Wd.MayEdit. The
> Message of the form's name works.
>
> Thanks in advance.
>
> Best regards,
>
> Roel
>
>
> Public Sub btnEdit_Click()
>      Dim Wd As Form
>
>      If main.Mayedit = True Then
>        main.MayEdit = False
>        btnEdit.Background = main.vbGrey
>      Else
>        main.MayEdit = True
>        btnEdit.Background = main.vbYellow
>      Endif
>
>      For Each Wd In ws.Windows
>        Message(Wd.Text)
>        Wd.MayEdit(False)
>      Next
> End
>

Form has no "MayEdit" method. You must cast your Wd object to its real 
type, or use a dynamic reference (i.e. declare Wd as "Object").

Regards,

-- 
Benoît Minisini




More information about the User mailing list