Exferia/Exferia_Controles/Exferia_Controles/Exferia_RadioButton.cs

84 lines
2.0 KiB
C#

using Exferia_Aplicacion.Visualizacion;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Exferia_Controles
{
public partial class Exferia_RadioButton : RadioButton
{
#region Propiedades publicas
internal bool g_bol_Obligatorio = false;
public bool Exferia_RadioButton_Obligatorio
{
set
{
g_bol_Obligatorio = value;
if (g_bol_Obligatorio)
{
BackColor = Colores.G_COLOR_FONDO_OBLIGATORIO;
}
else
{
BackColor = Colores.G_COLOR_FONDO_RADIOBUTTON;
}
}
get
{
return g_bol_Obligatorio;
}
}
bool g_bol_Bloqueable = true;
public bool Exferia_RadioButton_Bloqueable
{
set
{
g_bol_Bloqueable = value;
}
get
{
return g_bol_Bloqueable;
}
}
bool g_bol_Repintar_ColorFondoLetra = true;
public bool Exferia_RadioButton_Repintar_ColorFondoLetra
{
set
{
g_bol_Repintar_ColorFondoLetra = value;
}
get
{
return g_bol_Repintar_ColorFondoLetra;
}
}
internal bool g_bol_ReadOnly = false;
public bool Exferia_RadioButton_ReadOnly
{
get { return g_bol_ReadOnly; }
set { g_bol_ReadOnly = value; }
}
#endregion
public Exferia_RadioButton()
{
Margin = new Padding(3, 4, 3, 4);
TabStop = true;
}
protected override void OnClick(EventArgs e)
{
// pass the event up only if its not readlonly
if (!Exferia_RadioButton_ReadOnly) base.OnClick(e);
}
}
}