G
Guest
Can anyone help me with this? I'm trying to get an MDIChild form to lookup
the value of a control on another open MDIChild form, but can't seem to get
the right syntax.
Let's say the two child forms are Form1 and Form2. In VB4 I could use (in
Form2):
\\
If Form1.Option1.Value = True Then
//
However, in vb.NET 2003, even if I put the following in the Form2's Load event
\\
Dim MDIa as Form1
.....
If MDIa.Radiobutton1.Checked=True Then
//
I get the usual 'An unhandled exception of type
'System.NullReferenceException' message .... 'Object reference not set to an
instance of of an object'
even though when I put the cursor over the code 'MDIa.' a pop-up message
says 'Dim MDIa as ParentFileName.Form1' (the same pop-up says 'MDIa =
Nothing' if you Break aftyer the above runtime error occurs).
I have tried using 'Dim MDIa as New Form1' instead, which doesn't produce
the error but becasue I have declared it as 'New Form1' the default
Radionbutton on the form is checked instead of the one that I know is checked
on the (hidden) form (at least that is what I think is happening).
How can I get MDIChild Form2 to tell me the current status of a control on
MDIChild Form1. I have even tried going via the Parent form using some code
that (O)enone kindly gave me a couple of weeks ago, but I don't yet have
sufficient ability in vb.NET 2003 to correctly setup the syntax.
Many thanks in advance for any help that anyone can give me.
the value of a control on another open MDIChild form, but can't seem to get
the right syntax.
Let's say the two child forms are Form1 and Form2. In VB4 I could use (in
Form2):
\\
If Form1.Option1.Value = True Then
//
However, in vb.NET 2003, even if I put the following in the Form2's Load event
\\
Dim MDIa as Form1
.....
If MDIa.Radiobutton1.Checked=True Then
//
I get the usual 'An unhandled exception of type
'System.NullReferenceException' message .... 'Object reference not set to an
instance of of an object'
even though when I put the cursor over the code 'MDIa.' a pop-up message
says 'Dim MDIa as ParentFileName.Form1' (the same pop-up says 'MDIa =
Nothing' if you Break aftyer the above runtime error occurs).
I have tried using 'Dim MDIa as New Form1' instead, which doesn't produce
the error but becasue I have declared it as 'New Form1' the default
Radionbutton on the form is checked instead of the one that I know is checked
on the (hidden) form (at least that is what I think is happening).
How can I get MDIChild Form2 to tell me the current status of a control on
MDIChild Form1. I have even tried going via the Parent form using some code
that (O)enone kindly gave me a couple of weeks ago, but I don't yet have
sufficient ability in vb.NET 2003 to correctly setup the syntax.
Many thanks in advance for any help that anyone can give me.