Nullable Rectangle
-
hi is there a way of changing one of the properties of a nullable rectangle. for example.
private Rectangle? m_RectangleShape; // Nullable Rectangle
m_RectangleShape.Value.X = value;The above is along the lines of what i am looking for, a way to change the x value Current attempt:
public int X
{
get
{
return m_LocationX;
}
set
{
// Draw new rectangle changing the value of x
ShapeRect = new Rectangle(value, m_LocationY, m_SizeX, m_SizeY);
}
} -
hi is there a way of changing one of the properties of a nullable rectangle. for example.
private Rectangle? m_RectangleShape; // Nullable Rectangle
m_RectangleShape.Value.X = value;The above is along the lines of what i am looking for, a way to change the x value Current attempt:
public int X
{
get
{
return m_LocationX;
}
set
{
// Draw new rectangle changing the value of x
ShapeRect = new Rectangle(value, m_LocationY, m_SizeX, m_SizeY);
}
}Before you can set properties on a nullable rectangle you have to initialise it. It is also best practice to test the
HasValue
property before setting properties of the value, though not needed at this point.Rectangle? m_RectangleShape = new Rectangle?();
m_RectangleShape.Value.X = ValueType;If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) www.JacksonSoft.co.uk