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

richard terry rterry at ...1822...
Sun Mar 2 12:27:44 CET 2008


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: referencing_form.png
Type: image/png
Size: 55220 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20080302/554c69c3/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: referencing_a_form.tar.gz
Type: application/x-tgz
Size: 7921 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20080302/554c69c3/attachment.bin>


More information about the User mailing list