Creating a Canvas for Drawing Rectangles in Windows Forms
Setting up the environment: Open Visual Studio and create a new Windows Application; Open the Form1; Drag and drop 5 panels onto the form. Be careful not to drop it onto the panels you are dropping; Select any panel and name it "canvas". Now copy and paste the code bellow: