本帖最后由 wltysy 于 2009-11-27 15:37:35 编辑

解决方案 »

  1.   

    你的ai是radioButton1_CheckedChanged函数里的一个局部变量,在button1_Click里面用肯定错了啊!
      

  2.   

    string ai=string.Empty;
    private void radioButton1_CheckedChanged(object sender, EventArgs e)
    {
    .....//
    }这样就都可以用了啊!
      

  3.   

    [Quote=引用 4 楼 wltysy 的回复:]
    真蠢我,谢了啊
      

  4.   

    可以直接就在确定按钮的单击事件里这样写啊private void button1_Click(object sender, EventArgs e)
    {
        if (radioButton1.Checked == true) 
                {                 MessageBox.Show("你的爱好是" + radioButton1.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); 
                } 
                else 
                { 
                    MessageBox.Show("请选择!","提示!", MessageBoxButtons.OK, MessageBoxIcon.Information); 
                } }