您的位置:首页 > 编程语言 > C#

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;

            }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  控件 c#