In c# for panel there no property to set border color directly.We can only set the border style using BorderStyle.
To set the border color of a panel,
Step 1 : Set BorderStyle property to None.
Step 2 : Draw a rectangle and set the pen color in paint event of the panel
private void panelpanelbordercolor1_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawRectangle(Pens.Red, e.ClipRectangle.Left, e.ClipRectangle.Top, e.ClipRectangle.Width - 1, e.ClipRectangle.Height -1); base.OnPaint(e); }
Popularity: 22% [?]

December 7th, 2009
joy
Posted in
Tags:

