In Winforms Textbox
, I have defined new ToolTip
and configured it. I have set the PasswordChar
to '*'. However, when caps lock is on, two tooltip
is 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:
One way is to derive your own textbox control from the existing one and handle the EM_SHOWBALLOONTIP message. Then just drag this control onto your form instead of the regular textbox control.
public partial class PasswordTextBox : TextBox
{
private const int EM_SHOWBALLOONTIP = 0x1503;
protected override void WndProc(ref Message m)
{
if (m.Msg == EM_SHOWBALLOONTIP)
{
m.Result = (IntPtr)0;
return;
}
base.WndProc(ref m);
}
public PasswordTextBox()
{
InitializeComponent();
}
}