public static void Validate(ValidateType type, Control control)
{
switch (type)
{
case ValidateType.OnlyNumbers:
{
control.KeyPress += ValidNumbers;
break;
}
case ValidateType.OnlyText:
{
control.KeyPress += ValidNumbers;
break;
}
}