Thanks Mark for your answer.
The code I published, was simplified. In the constructor it creates a Rectangle. That's the control that I'am trying to click
Members area
#region Miembros
private Graphics _Area = null;
private Font _Letra = new Font("Tahoma", 8, FontStyle.Regular, GraphicsUnit.Point);
private int _Izquierda = 0;
private int _Arriba = 0;
private int _Ancho = 0;
private int _Altura = 0;
private bool _Seleccionado = false;
private bool _Visible = true;
private Color _ColorBorde = Color.Black;
private Color _ColorBordeDefecto = Color.Black;
private float _AnchoBorde = 1;
private Color _ColorRelleno = Color.White;
redondeadas
#endregion
... the constructor
public Rectangulo(Graphics pG, int pIzquierda, int pDerecha, int pAncho, int pAltura)
{
_Area = pG;
_Izquierda = pIzquierda;
_Arriba = pDerecha;
_Ancho = pAncho;
_Altura = pAltura;
Mostrar();
}
... and where to show the shape
public void Mostrar()
{
Brush oSolidBrush = new LinearGradientBrush(new Rectangle(_Izquierda,_Arriba,_Ancho,_Altura),_ColorRelleno,Color.White,45,false);
Pen oPen = new Pen(_ColorBorde, _AnchoBorde);
_Area.FillRectangle(oSolidBrush, _Izquierda, _Arriba, _Ancho, _Altura);
_Area.DrawRectangle(oPen, _Izquierda, _Arriba, _Ancho, _Altura);
}