按钮和文本的acesskey属性如何在c#asp.net中工作 [英] how acesskey property of button and text works in c# asp.net

查看:82
本文介绍了按钮和文本的acesskey属性如何在c#asp.net中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

how acesskey property of button and text works in c# asp.net

推荐答案

参考 - WebControl.AccessKey属性 [ ^ ]。

Refer - WebControl.AccessKey Property[^].
Quote:

使用AccessKey属性指定Web服务器控件的键盘快捷方式。这样,您可以通过按ALT键和键盘上指定字符的键快速导航到控件。例如,将控件的访问键设置为字符串 D 表示用户可以通过按ALT + D导航到控件。

只有一个字符AccessKey属性允许使用string。如果您尝试将此属性设置为既不是 null 的值,则 [ ^ ],也不是单个字符串,抛出异常。

Use the AccessKey property to specify the keyboard shortcut for the Web server control. This allows you to navigate quickly to the control by pressing the ALT key and the key for the specified character on the keyboard. For example, setting the access key of a control to the string "D" indicates that the user can navigate to the control by pressing ALT+D.
Only a single character string is allowed for the AccessKey property. If you attempt to set this property to a value that is neither null, Empty[^], nor a single character string, an exception is thrown.



示例


Example

<asp:TextBox ID="TextBox1" 

     AccessKey="Y" 

     Text="Press Alt-Y to get focus here" 

     Columns="45"

     runat="server"/>


这篇关于按钮和文本的acesskey属性如何在c#asp.net中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆