if   (MessageBox.Show("Are you sure?", "??", MessageBoxButtons.YesNo)==DialogResult.OK)   
{   
     textBox1.Text="dd";
}大家帮我看看,为什么点了“确定”按钮之后没有执行textBox1.Text="dd";

解决方案 »

  1.   

    if (MessageBox.Show("Are you sure?", "??", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    this.textBox1.Text = "dd";
                } 
      

  2.   

    if   (MessageBox.Show("Are you sure?", "??", MessageBoxButtons.YesNo)==DialogResult.Yes)    
    {    
         textBox1.Text="dd"; 

      

  3.   

    前后要对应!要是你后面用OK,那前面就用OKCANCEL
      

  4.   

    if   (MessageBox.Show("Are you sure?", "??", MessageBoxButtons.YesNo)==DialogResult.OK)    
    {    
         textBox1.Text="dd"; 
    } 你都是YesNo了怎么还判断为OK呢。
      

  5.   

    谢谢大家的帮忙。已解决。正如Thunder_li , Guyschaos , Kamui(湿他就湿他)所说。