[Gambas-user] Accessing control in different form
Rob
sourceforge-raindog2 at ...94...
Tue Aug 12 05:35:05 CEST 2003
Oops, sorry to have led you astray, I just tried that and it doesn't work.
It says "unknown symbol 'textbox1' in class 'fmain'" which makes sense because
textbox1 isn't a symbol, it's a child.
But going me.parent!textbox1.text = "xx" gets you "Not an array".
me.parent.children!textbox1.text = "xx" gets "unknown symbol 'children' in
class 'control'".
dim x as object
x = me.parent
x.children!textbox1.text = "xx"
gets you "Not an array" again.
Changing that last line to x.children("textbox1").text = "xx" gives you
"Expected .ContainerChildren, got String instead".
And you can loop through x.children using for each, but there doesn't seem to
be any way to find out each child's name!
Benoit, how would you do this? Updating fields on one form from another is an
everyday occurrence in VB. All of the above examples fail the same way
whether "Form controls are public" is set or not....
Rob
More information about the User
mailing list