0

I have two panels of equal length. Lets say 100x100 and I am drawing a line from (0,0) to (50,50) on both of the panels

enter image description here

This is the result of it. Both panels are transparent in color. Is it not possible to show the both the drawings together when two panels overlap each other?

panel1.CreateGraphics().DrawLine(new Pen(Color.Red,3),new Point(0,0), new Point(100,100));
panel2.CreateGraphics().DrawLine(new Pen(Color.Red,3),new Point(0,0), new Point(100,100));

The code is very basic.

Both panels draw a basic line via Pen.

supernerd
  • 379
  • 4
  • 13
  • 2
    [Transparent Overlapping Circular Progress Bars (Custom Control)](https://stackoverflow.com/a/53379442/7444103) -- Panels have a slightly different behavior when made transparent than other Controls, as the PictureBox or a Label (see, e.g., [Translucent circular Control with text](https://stackoverflow.com/a/51435842/7444103)). Don't use `CreateGraphics()` for this, or ever, if you need the drawing to persist – Jimi Jun 10 '23 at 13:23

0 Answers0