关闭Caps Lock警告消息

编程入门 行业动态 更新时间:2024-10-27 05:33:44
本文介绍了关闭Caps Lock警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨! 我有一个带有文本框"textbox1"的表单"form1". UseSystemPasswordChar = True,因为它将是一个密码字段.当我打开大写锁定时,会出现一条警告消息.我只想禁用这一个气球! 我有此代码,但是它不起作用!看来EM_SHOWBALLOONTIP的消息号不正确,但我找不到好消息.

Hi! I have a form ''form1'' with a textbox ''textbox1''. UseSystemPasswordChar=True because it would be a password field. When I turn on caps lock a warning message appears. I want to disable ONLY this one balloon! I have this code, but it doesn''t work! It looks like message number for EM_SHOWBALLOONTIP is not correct, but I can''t find the good one.

Public Delegate Sub DeActivateEventHandler() Public Class Form1 Private Const ECM_FIRST As Long = &H1500 Private Const EM_SHOWBALLOONTIP As Long = (ECM_FIRST + 3) Public Event DeActivate As DeActivateEventHandler Protected Overrides Sub WndProc(ByRef m As Message) If m.Msg = EM_SHOWBALLOONTIP Then MsgBox("Jump") RaiseEvent DeActivate() Else MyBase.WndProc(m) End If End Sub End Class

Could you help please?

推荐答案

将以下内容添加到文本框按下事件中 If e.KeyData = Keys.CapsLock Then e.SuppressKeyPress = True Add the following to the textbox key down event If e.KeyData = Keys.CapsLock Then e.SuppressKeyPress = True

如果在单击将显示消息的控件之前单击大写锁定,则此功能将无效 This won''t work if caps lock is already on before some one clicks on the control which will show the message

更多推荐

关闭Caps Lock警告消息

本文发布于:2023-10-16 06:10:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496719.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:消息   Caps   Lock

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!