简体   繁体   中英

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. 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

public void checkstatus()
{
if(textbox1.Text.Trim()=="" || textbox2.Text.Trim()=="" || textbox3.Text.Trim()=="")
{
 MessageBox.Show("Some Textboxes are empty");
}
else
{
 progessbar.Start();
}

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM