错误提供程序不显示消息并且不闪烁

本文关键字:闪烁 消息 显示 程序 错误 | 更新日期: 2023-09-27 17:49:31

我正在使用c#开发windows应用程序

我已经采取了一个错误提供程序和验证NULL textBox如下:

if (textBox1.Text == string.Empty)
{
    errorProvider1.SetError(textBox1, "Please enter Value");
}

但是当我运行程序时,它只显示图标但没有消息。它甚至不闪烁

我该怎么办?

错误提供程序不显示消息并且不闪烁

认为textBox1.Text为空。使用string.IsNullOrEmpty

if (string.IsNullOrEmpty(textBox1.Text))
{
   errorProvider1.SetError(textBox1, "Please enter Value");
}