0
我有這樣的C#代碼:爲什麼需要按兩次按鈕才能在此模式對話框中工作?
public partial class Continue : Form
{
public Continue(string colourName)
{
InitializeComponent();
lblMessage.Text = String.Format("Do you wish to change the colour to {0}", colourName);
}
private void btnConfirm_Click(object sender, EventArgs e)
{
btnConfirm.DialogResult = DialogResult.OK;
}
private void btnCancel_Click(object sender, EventArgs e)
{
btnCancel.DialogResult = DialogResult.Cancel;
}
}
它工作正常,但是當彈出對話框它要求我點擊一個按鈕兩次使用它。有沒有人有一個想法,爲什麼?
完美,謝謝! – Ross 2009-11-27 12:09:09