http://stackoverflow.com/questions/5885739/why-are-some-textboxes-not-accepting-control-a-shortcut-to-select-all-by-defau

You might be looking for the ShortcutsEnabled property. Setting it to true would allow your text boxes to implement the Ctrl+A shortcut (among others). From the documentation:

Use the ShortcutsEnabled property to enable or disable the following shortcut key combinations:

  • CTRL+Z

  • CTRL+E

  • CTRL+C

  • CTRL+Y

  • CTRL+X

  • CTRL+BACKSPACE

  • CTRL+V

  • CTRL+DELETE

  • CTRL+A

  • SHIFT+DELETE

  • CTRL+L

  • SHIFT+INSERT

  • CTRL+R

EDIT:
However, the documentation states:

The TextBox control does not support the CTRL+A shortcut key when the Multiline property value is true.

You will probably have to use another subclass of TextBoxBase, such as RichTextBox, for that to work.

http://stackoverflow.com/questions/16197915/how-can-i-allow-ctrla-with-textbox-in-winform

Like other answers indicate, Application.EnableVisualStyles() should be called. Also the TextBox.ShortcutsEnabled should be set to true.

But if your TextBox.Multiline is enabled then Ctrl+A will not work (see MSDN documentation). Using RichTextBox instead will get around the problem.

textbox不支持Ctrl+A的更多相关文章

  1. 解决winfrom下TextBox不支持透明背景色

    不知道微软扯什么拉鸡蛋子,居然有控件不支持透明,我实在想喷设计的人脑残.尤其可恨的是TextBox不支持,更可恨的是直到最新版.net4.6也不支持.源码又看不见,具体实现细节都不知道,谁能改得动?这 ...

  2. 【WP8】让TextBox文本支持滑动(Scroll)

    通过修改样式让TextBox支持文本滑动 在Silverlight上,TextBox是有文本滚动的功能的,当TextBox的文本过长时,可以进行拖动的,TextBox使用 VerticalScroll ...

  3. 在.net中实现在textbox中按ctrl+enter进行数据的提交

    textbox.Attributes.Add("onKeydown", "if(event.ctrlKey&&event.keyCode == 13){d ...

  4. 解决 aspx 页面 TextBox 不支持 type="number"

    安装 framework 4 并且打上补丁 Microsoft .NET Framework 4 可靠性更新 1 (KB2533523) https://www.microsoft.com/zh-cn ...

  5. JS-制作留言提交系统(支持ctrl+回车)

    弹出键值说明: //console.log(ev.keyCode)//回车:13//ctrl:17 <!DOCTYPE html> <html> <head> &l ...

  6. 让input支持 ctrl v上传粘贴图片? 让input支持QQ截图或剪切板中的图像数据(Java实现保存)

    原理:监听粘贴 → 获取粘贴内容 → 将内容上传 → 抓取后返回替换至input 我们在生产中用到的界面: 测试地址 http://sms.reyo.cn 用户名:aa 密码:123456 以下是PH ...

  7. 单个控件textbox只支持在英文状态下输入所需的字符串

    也就是它的属性: Imemode的属性 设置成off就可以了 ,就不会受到所输入的中文汉字了.

  8. Winform 使用热键功能实现Ctrl+C和Ctrl+V复制粘贴功能

    当我们使用winform控件的时候,会发现这些控件(比如Label)不支持Ctrl+c 复制和Ctrl+v 快捷键复制粘贴功能,如果我们需要实现这个功能改怎么做呢? 1. 首先我们创建一个winfor ...

  9. Windows Phone 的 TextBox 的实现 PropertyChanged

    比如,View 的文本框 TextBox1 绑定了 ViewModel 的 Msg 属性, 当想把文本框输入的内容输入过程中实时更新到绑定的 Msg ,在Windows Phone 中是无法通过设置  ...

随机推荐

  1. [MVC] - 异步调用后台的常用方法。

    1. 直接调用Action @Html.Action("GetTopArticle", "Home") 2. 通过url, 并用Jquery异步加载. < ...

  2. nodejs redis

    0. install redis library for node npm install redis 1.node command example > var _redis = require ...

  3. SOLVED: GATT callback fails to register

    I finally figured this problem out. The device I am using is a Samsung Galaxy S4 and the actual prob ...

  4. 30款jQuery常用网页焦点图banner图片切换 下载

    1.jquery 图片滚动特效制作 slide 图片类似窗帘式图片滚动 查看演示 2.jquery幻灯片插件带滚动条的圆形立体图片旋转滚动 查看演示 3.jQuery图片层叠旋转类似洗牌翻转图片幻灯片 ...

  5. Linux开机执行bash脚本

    问题描述:     Linux开机执行bash脚本     问题解决:         (1)在 /etc/init.d文件夹中新建一个脚本myinit                     (2) ...

  6. d3d11 effect state and default value tables

    Blend state State Default ValueAlphaToCoverage Enable FALSEIndependentBlend Enable FALSERenderTarget ...

  7. CDATA

    1DTD中的属性类型 全名:character data 在标记CDATA下,所有的标记.实体引用都被忽略,而被XML处理程序一视同仁地当做字符数据看待,CDATA的形式如下: <![CDATA ...

  8. jquery加入收藏代码

    <html> <head> <script type="text/javascript" src="jquery-1.9.1.js" ...

  9. Open multiple Eclipse workspaces on the Mac

    This seems to be the supported native method in OS X: cd /Applications/eclipse/ open -n Eclipse.app ...

  10. MSVC CRT运行库启动代码分析

    原文链接:http://www.programlife.net/msvc-crt-startup.html 在程序进入main/WinMain函数之前,需要先进行C运行库的初始化操作,通过在Visua ...