[英]Evertime I press a button I want it to indicate when my textbox or textboxes are empty in C#
Evertime I press a button I want it to indicate when my textbox or textboxes are empty.每当我按下一个按钮时,我希望它指示我的文本框或文本框何时为空。 Because there's 3 and I need this error to come up even when one out of all is empty.
因为有 3 个,即使其中一个为空,我也需要出现此错误。 If all textboxes are filled up I want my progress bar to start loading too.
如果所有文本框都已填满,我希望我的进度条也开始加载。 I'd really appreciate your help!
我真的很感谢你的帮助!
create keydown event for all textboxes same, and call the function为所有文本框创建相同的 keydown 事件,并调用 function
public void checkstatus()
{
if(textbox1.Text.Trim()=="" || textbox2.Text.Trim()=="" || textbox3.Text.Trim()=="")
{
MessageBox.Show("Some Textboxes are empty");
}
else
{
progessbar.Start();
}
} }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.