I am trying to get a variable to act as a reference variable. Any
suggestions on how to achieve this in c#? The variable will be of type
TextBox.
Thanks in advance!
Chris, Master of All Things Insignificant - 19 Jan 2005 20:32 GMT
I do VB so I'm going to hork up the C# code
TextBox A = New TextBox();
TextBox B = New TextBox();
TextBox Ref;
Ref= A;
Ref=Text() = "TextBox A";
Ref= B;
Ref.Text() = "TextBox B";
The Ref variable here is a reference to whatever TextBox you assign it to.
Is that what you needed?
Chris
>I am trying to get a variable to act as a reference variable. Any
> suggestions on how to achieve this in c#? The variable will be of type
> TextBox.
>
> Thanks in advance!
Jon Skeet [C# MVP] - 19 Jan 2005 20:42 GMT
> I am trying to get a variable to act as a reference variable. Any
> suggestions on how to achieve this in c#? The variable will be of type
> TextBox.
What exactly do you mean by "a reference variable"?

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too