如何在文本框上禁用系统的大写锁定通知 [英] How to disable system's caps-lock notification on Textbox

查看:35
本文介绍了如何在文本框上禁用系统的大写锁定通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Winforms文本框中,我定义了新的工具提示并对其进行了配置.但是,打开大写锁定时,将显示两个工具提示.其中一个是我的,另一个是系统的默认工具提示通知.我只想显示我的工具提示.我想禁用系统的工具提示.如何禁用它?

In Winforms Textbox, I have defined new ToolTip and configured it. However, when caps lock is on, two tooltips are shown. One of them is mine the other one is system's default tooltip notification. I only want to show my tooltip. I want to disable system's tooltip. How can I disable it ?

推荐答案

我找到了答案

I found an answer here, and have translated the code to VB.NET:

Public Class CustomMaskedTextBox
    Inherits MaskedTextBox

    Private m_DisableBalloonTips As Boolean
    Public Property DisableBalloonTips() As Boolean
        Get
            Return m_DisableBalloonTips
        End Get
        Set
            m_DisableBalloonTips = Value
        End Set
    End Property


    Protected Overrides Sub WndProc(ByRef m As Message)
        Private Const EM_SHOWBALLOONTIP As Integer = &H1503
        If m.Msg = EM_SHOWBALLOONTIP AndAlso DisableBalloonTips Then
            m.Result = IntPtr.Zero
            Return
        End If
        MyBase.WndProc(m)
    End Sub
End Class

这篇关于如何在文本框上禁用系统的大写锁定通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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