Hi Dave,
You need to pass a reference to your 1st form when declaring the 2nd, typically
Form2 f2 = new Form2(this); // Me in VB
Overload the constructor of the 2nd form to accept a 1st form parameter.
Store the parameter for later use
> Hi
>
[quoted text clipped - 34 lines]
>
> DaveG

Signature
Happy coding!
Morten Wennevik [C# MVP]
DaveG - 30 Apr 2005 20:51 GMT
Thanks Morten
Noe the problem is I have used the overload in normal funtions and subs
but never with the constructors, so now I'm a little lost, I understand
the reasons for the overload..... so the New form2(Me) will be excepted
bur how to implement it is where I am stuck......
> Hi Dave,
>
[quoted text clipped - 43 lines]
>>
>> DaveG
Morten Wennevik - 30 Apr 2005 22:46 GMT
Dave, overloading a constructor is done the exact same way, although I'm not sure how the VB syntax is. Store the Form1 reference for later use.
private Form1 myParent;
public Form2(Form1 f)
{
myParent = f;
}
then simply call
myParent.MethodOrSimilarInForm1()
whenever you need.
> Thanks Morten
>
[quoted text clipped - 50 lines]
>>>
>>> DaveG

Signature
Happy coding!
Morten Wennevik [C# MVP]