How to disable Caps Lock warning with password?

I get this when I have a Caps Lock with password control in focus. Instead, I would like to add my own warning. How can I disable this? I am not against P / Invoke or any native code, but it should be in C #.

enter image description here

+7
source share
2 answers

In your form, redefine WndProc so that it intercepts the EM_SHOWBALOONTIP message and does not allow the control to receive it:

protected override void WndProc(ref Message m) { if (m.Msg != 0x1503) //EM_SHOWBALOONTIP base.WndProc(ref m); } 
+5
source

The following code works for me in the KeyDown TextBox event:

  private void txtPassword_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.CapsLock) { e.SuppressKeyPress = true; } } 
+1
source

All Articles