PDA

View Full Version : سوال: تغییر شکل userControl



quantomquery
یک شنبه 20 اردیبهشت 1388, 12:02 عصر
سلام
چگونه می توان شکل یک فرم userControl را به دایره تغییر داد ؟
البته شنیدم با region می شه ولی نمی دونم چطوری ؟

esmaeily-hosein
یک شنبه 20 اردیبهشت 1388, 16:34 عصر
public class CircleControl : Control
{
public CircleControl()
{
SetStyle(ControlStyles.SupportsTransparentBackColo r, true);
}

protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.FillEllipse(Brushes.Green, this.ClientRectangle);
}
}