日期:2014-05-19  浏览次数:20831 次

在线等回复
namespace   currency
{
        public   partial   class   Form1   :   Form
        {
                public   Form1()
                {
                        InitializeComponent();
                }

                private   void   Form1_Load(object   sender,   EventArgs   e)
                {
                        this.textBox2.ReadOnly   =   true;
                        this.button2.Enabled   =   false;
                        this.button3.Enabled   =   false;
                }
               
                private   void   button1_Click(object   sender,   EventArgs   e)
                {
                        if   (this.textBox1.Text.Trim().Length   ==   0)
                        {
                                MessageBox.Show( "wrong.! ");
                        }
                }
                private   void   radio1_checked(object   sender,   EventArgs   e)
                {
                        if   (radioButton1.Checked)
                        {
                                this.button2.Enabled   =   true;
                                this.button3.Enabled   =   true;
                        }
                }
        }
}

1.当TEXTBOX1为空时,MESSAGEBOX不能显示
2.当选定RADIOBUTTON1后,BUTTON2和BUTTON3不能使用

请问一下这是为什么啊,?

------解决方案--------------------
我按照你的代码 测试通过

1.当TEXTBOX1为空时,MESSAGEBOX不能显示//你确定this.textBox1.Text.Trim().Length == 0

2.当选定RADIOBUTTON1后,BUTTON2和BUTTON3不能使用//radioButton1_CheckedChanged事件