1.向textbox中输入数据后,如何让它旁边的Button自动获得焦点

解决方案 »

  1.   

    前台
    function GetFocus()
    {
    if(event.keyCode==13)
    {
    document.getElementById("Button1").click();
    return false;
    }
    }------------------------
    后台
    TextBox1.Attributes.Add("onkeydown","return GetFocus();");
      

  2.   

    textbox.TabIndex = 1;
    Button.TabIndex = 2;
    输入后直接回车焦点就移到Button上了
      

  3.   

    textbox.TabIndex = 1;
    Button.TabIndex = 2;
    输入后直接回车焦点就移到Button上了
    我试了不好使前台
    function GetFocus()
    {
    if(event.keyCode==13)
    {
    document.getElementById("Button1").click();
    return false;
    }
    }------------------------
    后台
    TextBox1.Attributes.Add("onkeydown","return GetFocus();");
    也不好使