c#errorprovider控件基本使用随笔
2016-08-03 22:12
288 查看
核心: this.errorProvider1.SetError(this.username, "Please input your username!");
bool flag = true;
#region errorprovider
if (username.Text.Trim() == string.Empty)
{
this.errorProvider1.SetError(this.username, "Please input your username!");
flag = false;
}
else if (password.Text.Trim() == string.Empty)
{
this.errorProvider1.SetError(this.password, "Password can not be empty!");
flag = false;
}
else if (password.Text.Length != 8)
{
this.errorProvider1.SetError(this.password, "The length of Password must be eight!");
this.password.Text = "";
flag = false;
}
bool flag = true;
#region errorprovider
if (username.Text.Trim() == string.Empty)
{
this.errorProvider1.SetError(this.username, "Please input your username!");
flag = false;
}
else if (password.Text.Trim() == string.Empty)
{
this.errorProvider1.SetError(this.password, "Password can not be empty!");
flag = false;
}
else if (password.Text.Length != 8)
{
this.errorProvider1.SetError(this.password, "The length of Password must be eight!");
this.password.Text = "";
flag = false;
}
相关文章推荐
- 使用Linq to SQL实现基本的增、删、改、查及绑定控件(C#)
- c#2.0 中 利用errorProvider 控件检测错误
- C#工具箱的几个基本控件的使用
- [c#.net]做tooltip给控件动态添加属性的做法、IExtenderProvider接口的使用
- c# WinFrom ErrorProvider控件
- c# Calendar 日历控件 基本使用说明
- c#浮动文字框Tooltip控件的使用总结随笔
- 关于C#窗体基本控件使用心得(1)
- c# Calendar 日历控件 基本使用说明
- 【C#】使用IExtenderProvider为控件添加扩展属性,像ToolTip那样
- c# 使用MS SqlServer,连接成功,但是还报异常A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0。。。。
- Winform ErrorProvider控件使用
- c#.net]做tooltip给控件动态添加属性的做法、IExtenderProvider接口的使用
- C# 错误提示控件errorProvider
- ErrorProvider控件使用
- [c#.net]做tooltip给控件动态添加属性的做法、IExtenderProvider接口的使用
- ErrorProvider控件的使用
- c# 基本控件使用之浅谈
- c#.net]做tooltip给控件动态添加属性的做法、IExtenderProvider接口的使用
- 在C#中使用属性控件添加属性窗口