如何实现用回车键代替Tab键的功能
展开全部
<a使用Enter键代替Tab键的功能</a
<asp:textbox id=TextBox1 runat=server style=LEFT: 8px; POSITION: absolute; TOP: 48px</asp:textbox
<asp:textbox id=TextBox2 runat=server style=LEFT: 176px; POSITION: absolute; TOP: 48px</asp:textbox
<asp:textbox id=TextBox3 runat=server style=LEFT: 344px; POSITION: absolute; TOP: 48px</asp:textbox</form<script language=javascriptfunction keyDown(){var keycode=event.keyCode;
var keyChar=String.fromCharCode(keycode);
if(keycode==13)
event.keyCode=9;};document.on
keydown=keyDown;
</script</body</HTML后台代码(Enter-Tab.aspx.cs):
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace 示例代码._19{/// <summary
/// WebForm1 的摘要说明。
/// </summary
public class WebForm1 : System.Web.UI.Page{protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.TextBox TextBox3;
private void Page_Load(object sender, System.EventArgs e){// 在此处放置用户代码以初始化页面}#region Web Form Designer generated codeoverride protected void On
Init(EventArgs e){//// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。//InitializeComponent();base.OnInit(e);}
/// <summary
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
<asp:textbox id=TextBox1 runat=server style=LEFT: 8px; POSITION: absolute; TOP: 48px</asp:textbox
<asp:textbox id=TextBox2 runat=server style=LEFT: 176px; POSITION: absolute; TOP: 48px</asp:textbox
<asp:textbox id=TextBox3 runat=server style=LEFT: 344px; POSITION: absolute; TOP: 48px</asp:textbox</form<script language=javascriptfunction keyDown(){var keycode=event.keyCode;
var keyChar=String.fromCharCode(keycode);
if(keycode==13)
event.keyCode=9;};document.on
keydown=keyDown;
</script</body</HTML后台代码(Enter-Tab.aspx.cs):
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace 示例代码._19{/// <summary
/// WebForm1 的摘要说明。
/// </summary
public class WebForm1 : System.Web.UI.Page{protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.TextBox TextBox3;
private void Page_Load(object sender, System.EventArgs e){// 在此处放置用户代码以初始化页面}#region Web Form Designer generated codeoverride protected void On
Init(EventArgs e){//// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。//InitializeComponent();base.OnInit(e);}
/// <summary
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询