Bordes redondeados

06/02/2004 - 13:18 por Jonathan | Informe spam
Cual es la forma mas simple de hacerle bordes redondeados
a un form.
Si puede ser algun ejemplo o una pagina que explique :)
Gracias :D
 

Leer las respuestas

#1 Leonardo Moreno Forero
06/02/2004 - 15:23 | Informe spam
Hola Jonathan,

En el evento Load del formulario:

private void Form1_Load(object sender, System.EventArgs e)

{

GraphicsPath gp = new GraphicsPath();

RoundedRectangle(gp, new Rectangle(0, 0, this.Width, this.Height),

new Size(this.Width / 5, this.Height / 5));

this.Region = new Region(gp);

}

void RoundedRectangle(GraphicsPath gp, Rectangle rect, Size size)

{

gp.AddLine(rect.Left + size.Width / 2, rect.Top, rect.Right - size.Width /
2, rect.Top);

gp.AddArc(rect.Right - size.Width, rect.Top, size.Width, size.Height, 270,
90);

gp.AddLine(rect.Right, rect.Top + size.Height / 2, rect.Right, rect.Bottom -
size.Height / 2);

gp.AddArc(rect.Right - size.Width, rect.Bottom - size.Height, size.Width,
size.Height, 0, 90);

gp.AddLine(rect.Right - size.Width / 2, rect.Bottom, rect.Left + size.Width
/ 2, rect.Bottom);

gp.AddArc(rect.Left, rect.Bottom - size.Height, size.Width, size.Height, 90,
90);

gp.AddLine(rect.Left, rect.Bottom - size.Height / 2, rect.Left, rect.Top +
size.Height / 2);

gp.AddArc(rect.Left, rect.Top, size.Width, size.Height, 180, 90);

}

Atentamente,

Leonardo Moreno Forero
MCP - MCSD
Bogotá - Colombia
"Jonathan" escribió en el mensaje
news:bc7701c3ecab$567d2270$
Cual es la forma mas simple de hacerle bordes redondeados
a un form.
Si puede ser algun ejemplo o una pagina que explique :)
Gracias :D

Preguntas similares