Hi dsfsdfs, You can override the Panel.OnPaint method to draw a rectangle with gray color. Here is the example public class MyPanel : Panel { public MyPanel() { } protected override void OnPaint(PaintEventArgs e) { Rectangle rec = new Rectangle(e.ClipRectangle.Location.X, e.ClipRectangle.Location.Y, e.ClipRectangle.Width - 1, e.ClipRectangle.Height - 1); e.Graphics.DrawRectangle(Pens.Gray, rec); base.OnPaint(e); } } Based on my test, if I use e.ClipRectangle as the rectangle, the right bottom side line will be invisible, so I reduce it by 1 pixel. Sincerely, Kira Qian Please mark the replies as answers if they help and unmark if they don't.- Marked As Answer byKira QianMSFT, ModeratorWednesday, July 22, 2009 6:41 AM
-
|