找回密码
 立即注册

QQ登录

只需一步,快速开始

liyl10

高级会员

3

主题

14

帖子

1993

积分

高级会员

积分
1993

活字格认证

最新发帖
liyl10
高级会员   /  发表于:2014-1-16 10:32  /   查看:5831  /  回复:8
vb.net  
GrapeCity.Win.Input.Interop.Edit
如题:重写Edit后如何禁止F2按下后清空输入框?
是要在keydown事件或者PreviewKeyDown中实现吗?
有没有比较简单的办法?

8 个回复

倒序浏览
roger.wang
社区贡献组   /  发表于:2014-1-16 11:12:00
沙发
回复 1楼liyl10的帖子

禁止F2按下,这个代码供参考:

  1. FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();

  2.             im = fp_NodeTemple.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);

  3.             im.Put(new FarPoint.Win.Spread.Keystroke(Keys.F12, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
复制代码
回复 使用道具 举报
liyl10
高级会员   /  发表于:2014-1-16 11:23:00
板凳
spread中的F2可以通过spread desinger里面的属性来禁止,我现在是在非spread里的入力框有这个问题
回复 使用道具 举报
liyl10
高级会员   /  发表于:2014-1-16 11:28:00
地板
我用的是这个版本的:InputMan for Windows Forms 7.0J
跟这个帖子的问题有点类似
http://gcdn.grapecity.com/showtopic-2221.html
回复 使用道具 举报
roger.wang
社区贡献组   /  发表于:2014-1-16 11:38:00
5#
回复 4楼liyl10的帖子

InputMan产品啊,这个帖子里面的方法都试过了吗?
http://gcdn.grapecity.com/showtopic-2221.html
回复 使用道具 举报
liyl10
高级会员   /  发表于:2014-1-16 12:04:00
6#
试过了,在KeyDown中也是捕获不到F2,在form中的PreviewKeyDown中也是捕获不到
最后说通过Shortcut属性来取得F2的功能,然后把他删除
我是这么写的,一跑就报错:值不在有效范围内
Me.Shortcuts(Keys.F2) = Shortcut.None
Me.Shortcuts(Keys.F2) = Nothing 也是同样的问题
回复 使用道具 举报
liyl10
高级会员   /  发表于:2014-1-16 12:52:00
7#
亲爱的版主,不好意思,突然发现发错地方了.......
回复 使用道具 举报
liyl10
高级会员   /  发表于:2014-1-16 15:11:00
8#
Me.Shortcuts.Remove(Keys.F2)
这样搞定
谢谢版主
回复 使用道具 举报
roger.wang
社区贡献组   /  发表于:2014-1-16 16:42:00
9#
回复 8楼liyl10的帖子

自学成才,牛!  感谢分享   
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部