一个窗体上放4个单选按纽,一个BUTTON,一个TEXTBOX。
我想选择1个单选按纽,按BUTTON
TEXTBOX获得单选按纽的值,如何实现??谢谢。

解决方案 »

  1.   

    挨着check4个单选按钮的checked属性,如果是true,txt1.Text = radio1.Text
      

  2.   


    if(check1.checked)
      textbox1.text=check1.text
    else if(check2.checked)
      textbox1.text=check2.text
    else if(check3.checked)
      textbox1.text=check3.text
    else if(check4.checked)
      textbox1.text=check4.text
      

  3.   


    public void Button_Click(Object sender,EventArgs e)
    {
        if(RadioButton.SelectedValue != null)
       {
           TextBox.Text = RadioButton.SelectedValue
       }
    }
      

  4.   

    不行。。出错        
     RadioButton.SelectedValue
       
      

  5.   

    晕 不好意思 发错贴了.帮你看看吧! public void Button_Click(Object sender,EventArgs e)
    {
        if(check1.checked) 
          textbox1.text=check1.text; 
        else if(check2.checked) 
          textbox1.text=check2.text ;
        else if(check3.checked) 
          textbox1.text=check3.text ;
        else if(check4.checked) 
          textbox1.text=check4.text;
        else 
          textbox1.text="";
    }
      

  6.   

    单选按纽有个text属性,如radioButton.text
      

  7.   

    默认是RadioButton1吧,应该有个名字吧?