C# Programming
08-24-2009, 08:41 PM
Hi,
In windows form application I added one button "Draw Shape" and four radio button "Line, Circle, Rectangle, Triangle"
I have an abstract class Shape i inherited that Abstract class and created four class
Line, Circle, Rectangle, Triangle
On clicking the button "Draw shape" i need to draw the selected shape on the page.
Eg: In the case of circle i have function Draw()
From the main form i am calling Draw() function of the Circle class
In the Draw() function i am Drawing the circle
override public void Draw()
{
Graphics mg = CreateGraphics();
mg.DrawArc(new Pen(COLOR, THICKNESS), 100, 100, 45, 40, 0, 360);
}
I tryed like this.. But getting error How can i resolve this issue?
How can i paint the Form class from my class Circle?
Please Help me.
Regards,
Ratheesh.
In windows form application I added one button "Draw Shape" and four radio button "Line, Circle, Rectangle, Triangle"
I have an abstract class Shape i inherited that Abstract class and created four class
Line, Circle, Rectangle, Triangle
On clicking the button "Draw shape" i need to draw the selected shape on the page.
Eg: In the case of circle i have function Draw()
From the main form i am calling Draw() function of the Circle class
In the Draw() function i am Drawing the circle
override public void Draw()
{
Graphics mg = CreateGraphics();
mg.DrawArc(new Pen(COLOR, THICKNESS), 100, 100, 45, 40, 0, 360);
}
I tryed like this.. But getting error How can i resolve this issue?
How can i paint the Form class from my class Circle?
Please Help me.
Regards,
Ratheesh.