我正在使用以下代码检查空文本框,如果为空,则跳过复制到剪贴板并继续执行其余代码。
我不明白为什么会出现“值不能为空”异常。它不应该在不复制到剪贴板的情况下跳过吗?
我不明白为什么会出现“值不能为空”异常。它不应该在不复制到剪贴板的情况下跳过吗?
private void button_Click(object sender, EventArgs e)
{
if (textBox_Results.Text != null) Clipboard.SetText(textBox_Results.Text);
//rest of the code goes here;
}