[Gambas-user] How to reference control on another form (solved)

richard terry rterry at ...1822...
Sun Mar 2 22:37:52 CET 2008


Just to post the solution for other dummmies following my trail

Thanks to Mario - go to  Menu Project, Properties, Options and  in Compilation 
heading to Form Controls are Public.


Thanks Mario

=========================================
Previous posting was:

I would have thought this was easy, however for the life of me I cannot get it 
to work. This simple concept has bought my main project to a grinding halt!

I attach a picture and code, of something absolutely basic which I tried to 
get this concept to work - embed a form in a workspace, then when the button 
is clicked, change the text in the textbox.

1) form created (form1) with a textbox (textbox1) only
2) main form created with a workspace (workspace1)
        the form1 is added to the workspace on Fmain, and a button put 
underneath
===========================
Code for Fmain:

PUBLIC newform AS form1

PUBLIC SUB Form_Open()
 newform = NEW Form1
 newform.title = "Tab 1"
 
 Workspace1.Add(newform)
 
END

PUBLIC SUB Button1_Click()
'this dosn't work
  newform.textbox1.text = "hullo"

END
============================

Any help appreciated.

Richard




More information about the User mailing list