没有合适的资源?快使用搜索试试~ 我知道了~
好用的自定义验证控件
需积分: 9 0 下载量 19 浏览量
2012-06-20
17:20:18
上传
评论
收藏 7KB TXT 举报
温馨提示
试读
7页
public static bool ControlCheckOutNull(System.Windows.Forms.Control ctrl, string targt, System.Windows.Forms.ToolTip t) { if (string.IsNullOrEmpty(targt)) { t.ForeColor = System.Drawing.Color.Red; t.Show("此项不能为空!", ctrl, 2000); ctrl.Focus(); return false; } return true;
资源推荐
资源详情
资源评论
public class CheckFunction
{
/// <summary>
/// 检查数据是否为空
/// </summary>
/// <param name="c">需要检测的控件</param>
/// <param name="t">提示控件</param>
/// <returns></returns>
public static bool ControlCheckOutNull(SSRFID.ExControls.ExLabelToTextBox c, System.Windows.Forms.ToolTip t)
{
if (string.IsNullOrEmpty(c.Text))
{
t.ForeColor = System.Drawing.Color.Red;
t.Show("此项不能为空!", c, 2000);
c.Focus();
return false;
}
return true;
}
/// <summary>
/// 检查数据是否为空
/// </summary>
/// <param name="c">需要检测的控件</param>
/// <param name="t">提示控件</param>
/// <returns></returns>
public static bool ControlCheckOutNull(SSRFID.ExControls.ExTextBoxBase c, System.Windows.Forms.ToolTip t)
{
if (string.IsNullOrEmpty(c.Text))
{
{
/// <summary>
/// 检查数据是否为空
/// </summary>
/// <param name="c">需要检测的控件</param>
/// <param name="t">提示控件</param>
/// <returns></returns>
public static bool ControlCheckOutNull(SSRFID.ExControls.ExLabelToTextBox c, System.Windows.Forms.ToolTip t)
{
if (string.IsNullOrEmpty(c.Text))
{
t.ForeColor = System.Drawing.Color.Red;
t.Show("此项不能为空!", c, 2000);
c.Focus();
return false;
}
return true;
}
/// <summary>
/// 检查数据是否为空
/// </summary>
/// <param name="c">需要检测的控件</param>
/// <param name="t">提示控件</param>
/// <returns></returns>
public static bool ControlCheckOutNull(SSRFID.ExControls.ExTextBoxBase c, System.Windows.Forms.ToolTip t)
{
if (string.IsNullOrEmpty(c.Text))
{
t.ForeColor = System.Drawing.Color.Red;
t.Show("此项不能为空!", c, 2000);
c.Focus();
return false;
}
return true;
}
/// <summary>
/// 检查两个控件内容是否相同
/// </summary>
/// <param name="c">需要检测的控件</param>
/// <param name="d">需要检测的控件</param>
/// <param name="t">提示控件</param>
/// <returns></returns>
public static bool ControlCheckOutNullTwo(SSRFID.ExControls.ExTextBoxBase c,SSRFID .ExControls.ExTextBoxBase d, System.Windows.Forms.ToolTip t)
{
if (!string.IsNullOrEmpty(c.Text)&&!string .IsNullOrEmpty(d.Text))
{
if (c.Text!=d.Text)
{
t.ForeColor = System.Drawing.Color.Red;
t.Show("输入不一致", d, 2000);
d.Focus();
return false;
}
}
return true;
}
public static bool ControlCheckOutNull(System.Windows.Forms.Control ctrl, string targt, System.Windows.Forms.ToolTip t)
t.Show("此项不能为空!", c, 2000);
c.Focus();
return false;
}
return true;
}
/// <summary>
/// 检查两个控件内容是否相同
/// </summary>
/// <param name="c">需要检测的控件</param>
/// <param name="d">需要检测的控件</param>
/// <param name="t">提示控件</param>
/// <returns></returns>
public static bool ControlCheckOutNullTwo(SSRFID.ExControls.ExTextBoxBase c,SSRFID .ExControls.ExTextBoxBase d, System.Windows.Forms.ToolTip t)
{
if (!string.IsNullOrEmpty(c.Text)&&!string .IsNullOrEmpty(d.Text))
{
if (c.Text!=d.Text)
{
t.ForeColor = System.Drawing.Color.Red;
t.Show("输入不一致", d, 2000);
d.Focus();
return false;
}
}
return true;
}
public static bool ControlCheckOutNull(System.Windows.Forms.Control ctrl, string targt, System.Windows.Forms.ToolTip t)
剩余6页未读,继续阅读
资源评论
大海你就是水
- 粉丝: 8
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功