我试了一下,只有一个为空也提示信息。
private void btnsave_Click(object sender, EventArgs e)
{
if (txt_jf.Text =="" && txt_df.Text =="" );
{
MessageBox.Show("借贷方不能同时为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
txt_jf.Focus(); } }
private void btnsave_Click(object sender, EventArgs e)
{
if (txt_jf.Text =="" && txt_df.Text =="" );
{
MessageBox.Show("借贷方不能同时为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
txt_jf.Focus(); } }
{
}
&& txt_jf.Text.Trim() != ""
&& !String.IsNullOrEmpty(txt_df.Text)
&& txt_df.Text.Trim() != "")