TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Simon
NA
10
0
attempt at game of life, drawing the grid and filling the cells
Nov 30 2007 1:01 PM
hi guys, iv just started to create a grid for my "game of life", basically what i want to do is on mouse down i want the corresponding cell to fill with the color selected for my brush. i have drawn the grid as follows:
{
Pen p = new Pen(Color.Black);
g1 = Graphics.FromImage(grid);
for (int i = 0; i < 300; i = i + 50) ;
for (int i = 10; i < 300; i = i + 20)
{
g1.DrawLine(p, 10, i, 290, i);
}
for (int x = 10; x < 300; x = x + 20)
{
g1.DrawLine(p, x, 10, x, 290);
}
}
can anyone help me on how to fill the rectangles with my chosen color when clicked on? do i need to use DrawRectangle instead of DrawLine for the basic grid?
any help is great, thanks!!
Reply
Answers (
8
)
How to Show Form
KeyBoard Hook not working