dropdownlist控件失去焦点的小应用和函数substr

dropdownlist控件的AutoPostBack 设置为true,就是它会失去焦点前自动提交了; dropdownlist里面有几个items,如:单选题,多选题,打字题
然后,在事件DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
中加入代码
{if (DropDownList1.SelectedValue=="打字题")
   {
    CheckBox2.Enabled =false;
    }
   else
   {
    CheckBox2.Enabled =true;
  }
测试通过
另外:
hehe="我们这里还有鱼";
hehe.substr(1,2); //1代表从编号为1的字开始取,2代表取两个字(长度)。
注意字符串的编号是从0开始的,也就是说编号为1的其实是第二个字,所以hehe.substr(1,2)代表 “们这”。
原文地址:https://www.cnblogs.com/pyman/p/1232911.html