views:

27

answers:

1

Hi, i want to create an info box in .net 2 (attached is an image with an example)alt text I wanted to use a panel, but I cannot change the color of its border.

is it possible to change this property? if so, how?

Thanks, Shukyalt text

+2  A: 

You can't change the color of the border directly, but, you draw your own in any color and style you wish. See this article.

Example of the code from the article. (That's all you'll need.)

private void panel1_Paint(object sender, PaintEventArgs e)     {
    ControlPaint.DrawBorder(e.Graphics, this.panel1.ClientRectangle, 
    Color.DarkBlue, ButtonBorderStyle.Solid);
}

private void panel1_Resize(object sender, EventArgs e)
{
    Invalidate();
}
Paul Sasik
Thanks Paul,this is exactly what I needed.
Shuky Kappon