Hi, not sure if the title is correct but I think that's what I mean.
I have the following code:
//Box the shape is contained in
protected Rectangle container;
/// <summary>
/// Gets or sets the value for position
/// </summary>
public Point Position
{
get { return container.Location; }
set { container.Location = value; }
}
And then later in a derived class I have the function
public override void move(Point destination)
{
Position.X += destination.X;
Position.Y += destination.Y;
}
When I compile this it says Error 1 Cannot modify the return value of 'TextVisualiser.Drawing.basicShapes.Position' because it is not a variable
. What does this mean? Do I have to have a variable with the same name as the property?
Thanks for any and all help.
Andrew.