I get this when I have Caps Lock on with a password control in focus. I would like to add my own warning instead. How can I disable this one? I don't mind P/Invoke or any native code but it has to be in C#.
Asked
Active
Viewed 2,535 times
7
-
would @M. Nasser Javaid answer to a related topic help? http://stackoverflow.com/questions/1092808/warn-about-capslock – luchosrock Jan 09 '13 at 17:11
2 Answers
5
In your form, override WndProc like so, which will intercept the EM_SHOWBALOONTIP message and prevent the control from receiving it:
protected override void WndProc(ref Message m)
{
if (m.Msg != 0x1503) //EM_SHOWBALOONTIP
base.WndProc(ref m);
}

jlew
- 10,491
- 1
- 35
- 58
1
The following code works for me, on the KeyDown
event of a TextBox
:
private void txtPassword_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.CapsLock)
{
e.SuppressKeyPress = true;
}
}

hunch_hunch
- 2,283
- 1
- 21
- 26

Alexander
- 21
- 1
-
2Did you notice the question is in English? Does it help to post an answer in another language? – Gutblender Sep 25 '14 at 15:49