I am new to here as well to c#, I am trying to draw the rectangular graphics for for around the button but unfortunately after placing the group box it is not visible i tried with send back and bring front options still no effective result, if i remove the group box from the form this will draw rectangle and visible in form.
Looking for possible solution from experts.
System.Drawing.Graphics graphicsobj;
graphicsobj = this.CreateGraphics();
Pen mypen = new Pen(System.Drawing.Color.Red, 5);
int x1[enter image description here][1] = button1.Location.X;
int y1 = button1.Location.Y;
int width1 = button1.Width;
int height1 = button1.Height;
graphicsobj.DrawRectangle(mypen, x1, y1, width1, height1);