【VB.NET】类绑定控件,实现文本框快捷键全选
Public Class KeyBinder
Public Sub BindControl(ByRef CControl As TextBox)
AddHandler CControl.KeyDown, AddressOf TextKeyDown
End Sub Private Sub TextKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
MsgBox(sender)
Dim txtControl As TextBox = CType(sender, TextBox)
If e.KeyCode = Keys.A AndAlso (e.KeyData And Keys.Control) Then
'全选
txtControl.SelectAll()
End If
e.SuppressKeyPress = True
End Sub
End Class
Public Class KeyBinder
Public Sub BindControl(ByRef CControl As TextBox)
AddHandler CControl.KeyDown, AddressOf TextKeyDown
End Sub Private Sub TextKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
MsgBox(sender)
Dim txtControl As TextBox = CType(sender, TextBox)
If e.KeyCode = Keys.A AndAlso (e.KeyData And Keys.Control) Then
'全选
txtControl.SelectAll()
End If
e.SuppressKeyPress = True
End Sub
End Class
【VB.NET】类绑定控件,实现文本框快捷键全选的更多相关文章
- [WPF]实现TextBox文本框单击全选
原文:[WPF]实现TextBox文本框单击全选 /// <summary> /// Void:设置获取焦点时全选文本 /// </summary&g ...
- 用MVC的辅助方法自定义了两个控件:“可编辑的下拉框控件”和“文本框日历控件”
接触MVC也没多长时间,一开始学的时候绝得MVC结构比较清晰.后来入了门具体操作下来感觉MVC控件怎么这么少还不可以像ASP.net form那样拖拽.这样设计界面来,想我种以前没学过JS,Jquer ...
- 在GridView控件内文本框实现TextChanged事件
本篇是教你实现GridView控件内的TextBox文本框实现自身的TextChanged事件.由于某些功能的需求,GridView控件内嵌TextBox,当TextBox值发生变化时,触发TextC ...
- 转:zTree树控件扩展篇:巧用zTree控件实现文本框输入关键词自动模糊查找zTree树节点实现模糊匹配下拉选择效果
是否可以借助于zTree实现文本框输入关键词自动模糊匹配zTree下拉树,然后选择下拉树内节点显示在文本框内且隐藏下拉树. 看到这个需求脑子里头大致已经想到了要如何实现这样一个需求,当时是限于时间问题 ...
- 根据窗体自动调整控件及文本框记住上次填写内容Demo
第一次写文章,组词难免没有不通之处... 最近常用到Winform根据窗体大小自动调整空间大小及字体.文本框记住上次填写内容待下次输入某一段时候自动跳出上次输入内容.于是就随便把两个问题放到同一个de ...
- jquery easyui 日历控件和文本框结合使用生成日期
html部分---等待接收所选日期的文本框 <td> <input name='input_date' required class='easyui-textbox' id='xiw ...
- EasyUI 的日期控件单击文本框显示日历
注意:可 用 ctrl+f 搜索 "_outerWidth():0" 1. jQuery.easyui.min.js1.3.2 版本 function _745(_746,_7 ...
- MFC对话框的Edit控件实现响应Ctrl+A全选,并实现自动/手动换行+滚动条
首先是在Properties中设置控件属性的问题,首先必须得将Mutilines属性设为true,才能支持多行显示. 手动换行(按Enter键换行):将Want Return属性设为true 自动换行 ...
- 控件篇:CheckedListBox的全选与反选
private void cbXmlAll_CheckedChanged(object sender, EventArgs e) { for (int i = 0; i < cblXmlList ...
随机推荐
- 没有纳入spring管理的类如何注入spring管理的对象
spring 如何在普通类中调用注入的对象? spring 在Thread中注入@Resource失败,总为null~解决 springmvc 注入总是空指针异常? 以上的几个问题就是我在项目中遇到的 ...
- oracle生成行方法
数据库记录是行的集合 set of row, 那么如何如何生成集合呢? oracle中常用的是 递归查询(with ... union all ...) 以及 connect by(树形查询) htt ...
- The data is said to include information from networks
The data is said to include information from networks as well as from individual computers and smart ...
- 第1章 Express MongoDB 搭建多人博客
学习环境 Node.js : 0.10.22 + Express : 3.4.4 + MongoDB : 2.4.8 + 快速开始 安装 Express express 是 Node.js 上最流行的 ...
- (转)PhoneGap工作原理及需改进的地方
原文:http://mobile.51cto.com/web-330900.htm PhoneGap工作原理及需改进的地方 2012-04-18 16:42 佚名 网络整理 字号:T | T 目前开发 ...
- Libgdx 开发指南(1.3) 应用框架——查询、日志
查询 Application接口提过多种方法查询运行时环境属性. 获得应用类型 有时候根据运行平台需要处理一些具体的逻辑,可以使用 Application.getType() 方法来返回应用所运行的平 ...
- B - Encoded Love-letter 字符串的处理
B - Encoded Love-letter Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & % ...
- window.location和window.open
window.location和window.open的区别 window.location = "http://www.baidu.com" 跳转后有后退功能 window.lo ...
- YUSE_DOWN-批下载
*&---------------------------------------------------------------------**& Report YTST_CX_DO ...
- 动态添加Marquee标签,并动态赋值与属性
前台加载js $(function(){ var publishStr="<%=publishText%>" var marqueeStr=" <mar ...