i'am not sure what do you mean, but i'am try to answer your question,
class A
{
private B clsb;
public string data;
public A()
{
clsb = new B(this);
data = "Data From Class A";
clsb.doSomething(1, 1);
}
}
class B
{
private A clsa;
public B(A classA)
{
clsa = classA;
}
public void doSomething(int a, int b)
{
System.Windows.Forms.MessageBox.Show(clsa.data);
}
}
i hope this code help u
Thanks,
Gbu
On Wed, Mar 30, 2011 at 9:14 AM, Learner <[email protected]> wrote:
> Hi,
>
> I have two classes say Class A and Class B. I am trying to find how
> do I get reference of Class A in Class B.
>
> I do not want to get a new instance of Class A. I want to be able to
> reference to the loaded instance.
>
> Class A
> {
> ....
> Class B clsb = New Class B();
> clsb.DoSomething(int a, int b)
> }
>
>
> Class B
> {
> ...
> public void DoSomething(int a, int b)
> {
> ....
> //I want to be able to reference to the loaded instance of the
> Class A. (not a new instance)
> }
> }
>
> Can some one please help me with this.
>
> Thanks,
> L
>
> --
> You received this message because you are subscribed to the Google
> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
> Web Services,.NET Remoting" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
> or visit the group website at http://megasolutions.net
>
--
Dickta
--
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net