References

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to pass a form somehow as a reference

forms.Add(ref this)

This does not seem to work as it says that 'this' is readonly. 'this' is a form.
 
Confused said:
Is it possible to pass a form somehow as a reference?

forms.Add(ref this);

This does not seem to work as it says that 'this' is readonly. 'this' is a form.

A form is already a reference type - you don't need to pass it *by*
reference. You need to be very clear about the difference between
passing something *by* reference and passing *a* reference by value.

See http://www.pobox.com/~skeet/csharp/parameters.html
 
Back
Top