[Gambas-user] Communicating to hosted forms...

Charlie Reinl Karl.Reinl at ...2345...
Thu Jan 1 22:55:33 CET 2015


Am Donnerstag, den 01.01.2015, 21:57 +0100 schrieb Tobias Boege:
> On Thu, 01 Jan 2015, Stephen wrote:
> > I just extracted the archive from the email, loaded it and of course it 
> > works perfectly.
> > 
> > I had this;
> > 
> > mhform1.textbox2.text = value
> > 
> > and
> > 
> > mgform2.textbox2.text = value
> > 
> > in my original code but I kept getting "null object" every time it tried 
> > execute the line.
> > 
> > Thanks for putting up with my stupidity and taking the time to help out.
> > 
> 
> That's why I found it better to send a patch in this case (I attach the one
> with Charlie's changes). You will see that he switched a setting in the
> project properties:
> 
>   +ControlPublic=1
> 
> which makes all controls on all forms public variables (they're private by
> default for reasons of sanity). With this setting enabled, your problem is
> trivial as you see.
> 
> I think Charlie wanted you to find that setting by yourself. I think this is
> a bit unfair as the setting is well hidden in the project options dialog :-)
> 
> Regards,
> Tobi
> 
Salut Tobi,

but that was not the main problem, +ControlPublic=1 was just a first
change to see, and that was not turned back.

Stephen problem was here 

 Private Sub InitializeControls()
-  mhForm1 = New Form1(Frame1) As "Form1"
-  mhForm2 = New Form2(Frame2) As "Form2" 
+  mhForm1 = New Form1(Frame1) As "myForm1"
+  mhForm2 = New Form2(Frame2) As "myForm2" 
 End

and that made it work easier 

 ' Gambas class file
 
-Public mhForm1 As Form
-Public mhForm2 As Form
+Public mhForm1 As Form1
+Public mhForm2 As Form2
 
But thanks to fix the patch function in the IDE

Gesundes neues Jahr
-- 
Amicalement
Charlie





More information about the User mailing list