Click here to Skip to main content
15,667,736 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I draw lines on a button table? I am trying to make a tic-tac-toe game with different sizes and I am now onto the scoring part of the program. Right now, I have tried making lines on the program, but they appear on the Form behind the tablelayoutpanel. How would I bring the line in front of the panel and the buttons on the panel?

What I have tried:

So far, I have tried #include <graphics> in the program, and the code below to draw the line:
Graphics^ pg = CreateGraphics();
Pen^ red_pen = gcnew Pen(Color::Red);
pg->DrawLine(red_pen, 300,150, 60,60);
delete pg;
but I am trying to figure out how to bring the line out front
Updated 10-Oct-22 8:15am

1 solution

Look at using a GraphicsRegion[^]

A region is a portion of the display area of an output device. Regions can be simple (a single rectangle) or complex (a combination of polygons and closed curves).
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