Z
Zany
Hi,
Could someone please explain why the following doesn't compile. This turned
up as I was programming yesterday.
Thanks,
Zany
public class A {
public Rectangle r;
public Rectangle GetRect {
get {return r;}
}
public void Test() {
r.Width = 5; // works
Rectangle r1 = GetRect; // works
GetRect.Width = 5; // <-- won't compile
//
// Cannot modify the return value of 'A.GetRect' because it is not a
variable
//
}
}
Could someone please explain why the following doesn't compile. This turned
up as I was programming yesterday.
Thanks,
Zany
public class A {
public Rectangle r;
public Rectangle GetRect {
get {return r;}
}
public void Test() {
r.Width = 5; // works
Rectangle r1 = GetRect; // works
GetRect.Width = 5; // <-- won't compile
//
// Cannot modify the return value of 'A.GetRect' because it is not a
variable
//
}
}