gpt4 book ai didi

c# - 如何在不将鼠标悬停在错误提供程序上的情况下显示错误?

转载 作者:行者123 更新时间:2023-11-30 16:16:20 27 4
gpt4 key购买 nike

如何在不将鼠标悬停在错误提供程序上的情况下显示错误? enter image description here

this.errorProvider1.SetError(textBox1, "This field must contain text");

最佳答案

可能不是最好的选择,但应该可行

    if (textBox1.Text == "")
{
ErrorProvider myerror = new ErrorProvider();
ToolTip mytip = new ToolTip();
myerror.SetError(textBox1, "This field must contain text");
mytip.Show("This field must contain text", textBox1);
}

关于c# - 如何在不将鼠标悬停在错误提供程序上的情况下显示错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18518902/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com