private void button1_Click(object sender, System.EventArgs e)
{
if (txt_user_id.Text =="")
{
MessageBox.Show("請輸入用戶ID!");
}
//other code
}
如果輸入內容為空,怎么跳出button1_Click,不執行余下的代碼(other code)?
不要用GOTO,也不要用IF ELSE .
{
if (txt_user_id.Text =="")
{
MessageBox.Show("請輸入用戶ID!");
}
//other code
}
如果輸入內容為空,怎么跳出button1_Click,不執行余下的代碼(other code)?
不要用GOTO,也不要用IF ELSE .
{
MessageBox.Show("請輸入用戶ID!");
return;
}