问题
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 ?
回答1:
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
来源:https://stackoverflow.com/questions/25460336/how-to-disable-systems-caps-lock-notification-on-textbox