El 13/05/10 00:08, Jussi Lahtinen escribió: > Project properties --> Check: Form controls are public. > > Jussi > > > On Thu, May 13, 2010 at 00:45, craf <p...@vtr.net> wrote: >> Hi. >> >> I need to call a control that is located on the main form from a module, >> for this I have dealt with the following code: >> >> 'in module >> >> public sub proc_add() >> >> Fmain.control.text= "Hello" >> >> end sub >> >> But this form of call control does not work. >> >> Regards >>
If you wont your controls to be public, use Properties instead. (I think it is not a good idea to make public controls) In your form: PROPERTY myText as String ' then two functions will be created automagically: PRIVATE SUB myText_Write(value as String) textarea.Text = value END PRIVATE FUNCTION myText_Read() as String RETURN textArea.Text END Then you could call your property from within a module or another class MyForm.myText = whatevertext 'or whatsmytext = MyForm.myText Hope this helps Jesus ------------------------------------------------------------------------------ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user