Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, i'm new on this site and i try to learn C#.
I have a question about the four color problem. I need to do an aplication that simulate the four color maps in win forms. I know how to do in console application using backtracking, but i tried to do in win form using the same algorithm but i don't know how to draw.
Can anyoane help me with source code of how i can implement this or with source code of the entirely application ?
Thanks!
Posted

1 solution

No, this is your homework, and you are expected to do it yourself, not get marked on what we do! :laugh:

Drawing in Winforms is easy: just handle the Paint event for a Form or Panel, and use the supplied Graphics context.
For example, this will draw a Green Rectangle overlapping a Red Circle:
C#
private void myPanel_Paint(object sender, PaintEventArgs e)
    {
    Graphics g = e.Graphics;
    g.FillEllipse(Brushes.Red, 100, 100, 200, 200);
    g.FillRectangle(Brushes.Green, 150, 150, 50, 50);
    }


So try it, experiment, and see what happens!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900