المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : AddRectangle Exception



C# Programming
02-10-2010, 12:23 AM
Hi i seem to be getting an argumentException on the indicated line for no reason that i can see.

There is a perameter not valid message however it is, as i create the rectangle and add it straight away.


// Add two rectangles to graphics path
Rectangle rectangle = new Rectangle(5, 5, 10, 10);

// Create two rectangles representing the node and expand box
Rectangle textBacking = new Rectangle(m_expandBox.Width + (m_gap * 2),
m_gap - (int)(m_gap * 0.5), Size.Width - m_gap, Size.Height - m_gap);

-----> m_gpExpandBox.AddRectangle(rectangle);
m_gpTextBacking.AddRectangle(textBacking);

Does anyone know why this is happening. I cannot see any information on the net that would reveal the cause of the problem.

Thanx George