设置pictureBox的边框颜色

private void pictureBox2_Paint(object sender, PaintEventArgs e)   
{   
            PictureBox p = (PictureBox)sender;   
            Pen pp = new Pen(Color.Red);   
            e.Graphics.DrawRectangle(pp, e.ClipRectangle.X, e.ClipRectangle.Y,
e.ClipRectangle.X
+ e.ClipRectangle.Width - 1,
e.ClipRectangle.Y + e.ClipRectangle.Height - 1);

}
posted @ 2016-07-30 11:22  Hardsoftware  阅读(4963)  评论(0编辑  收藏  举报