473,796 Members | 2,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Caps Lock Warning for Password Control

I'm not sure when it came into being, since this it the first time I
have worked very much with a password control in .NET, but if a
textbox that has a non-empty value for PasswordChar or the
UseSystemPasswo rdChar property is true, and the textbox has focus, if
the Caps Lock key is pressed, a warning balloon tooltip is
automatically displayed by the system. I cannot even find
documentation that describes this behaviour.

My question is, is there anyway to temporarily turn that off in code?
Jul 11 '08 #1
4 6020
za***@construct ion-imaging.com wrote:
I'm not sure when it came into being, since this it the first time I
have worked very much with a password control in .NET, but if a
textbox that has a non-empty value for PasswordChar or the
UseSystemPasswo rdChar property is true, and the textbox has focus, if
the Caps Lock key is pressed, a warning balloon tooltip is
automatically displayed by the system. I cannot even find
documentation that describes this behaviour.
There isn't any, it's a courtesy of your friendly neighborhood common
controls library. :-)
My question is, is there anyway to temporarily turn that off in code?
My question is, why on earth would you want to? It's saved my bacon a few
times. That said...

The behavior you describe comes with the system edit control. The system
(well, actually, "something" , it's always hard to tell) will send an
EM_SHOWBALLOONT IP message, which you can suppress by (for example) using a
custom control that overrides WndProc:

public class CustomMaskedTex tBox : MaskedTextBox {
private const int EM_SHOWBALLOONT IP = 0x1503;
public bool DisableBalloonT ips { get; set; }

protected override void WndProc(ref Message m) {
if (m.Msg == EM_SHOWBALLOONT IP && DisableBalloonT ips) {
m.Result = (IntPtr) 0;
return;
}
base.WndProc(re f m);
}
}

A more general method would be to use some way of subclassing the control,
since this can apply to any edit box.

Since you cross-posted this in the C# and VB groups, I trust you can
translate it to VB yourself if necessary. For future reference, a better
group would have been microsoft.publi c.dotnet.framew ork.windowsform s, since
this is not a language-specific question.

--
J.
Jul 11 '08 #2
On Jul 11, 2:54*pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
za...@construct ion-imaging.com wrote:
I'm not sure when it came into being, since this it the first time I
have worked very much with a password control in .NET, but if a
textbox that has a non-empty value for PasswordChar or the
UseSystemPasswo rdChar property is true, and the textbox has focus, if
the Caps Lock key is pressed, a warning balloon tooltip is
automatically displayed by the system. I cannot even find
documentation that describes this behaviour.

There isn't any, it's a courtesy of your friendly neighborhood common
controls library. :-)
My question is, is there anyway to temporarily turn that off in code?

My question is, why on earth would you want to? It's saved my bacon a few
times. That said...
My company uses a third part software packe that our software
integrates with. The third part software has two methods of security,
one uses Active Directory, where the password is defiitely case
sensitive. But the password for the builtin security is not case
sensitive. That is why I would like to be able to turn it off, if the
database is configured to use the third party software security, there
is no need to warn the user that the Caps Lock key is on.
>
The behavior you describe comes with the system edit control. The system
(well, actually, "something" , it's always hard to tell) will send an
EM_SHOWBALLOONT IP message, which you can suppress by (for example) using a
custom control that overrides WndProc:

* *public class CustomMaskedTex tBox : MaskedTextBox {
* * *private const int EM_SHOWBALLOONT IP = 0x1503;
* * *public bool DisableBalloonT ips { get; set; }

* * *protected override void WndProc(ref Message m) {
* * * *if (m.Msg == EM_SHOWBALLOONT IP && DisableBalloonT ips) {
* * * * *m.Result = (IntPtr) 0;
* * * * *return;
* * * *}
* * * *base.WndProc(r ef m);
* * *}
* *}

A more general method would be to use some way of subclassing the control,
since this can apply to any edit box.

Since you cross-posted this in the C# and VB groups, I trust you can
translate it to VB yourself if necessary. For future reference, a better
group would have been microsoft.publi c.dotnet.framew ork.windowsform s, since
this is not a language-specific question.
Thanks, I will try your segguestion. I crossposted to both groups
cause it was, as you say, not language specific. I was unaware of the
other newsgroup, in the future I will first try there.
Jul 11 '08 #3
za***@construct ion-imaging.com wrote:
On Jul 11, 2:54 pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
>za...@construc tion-imaging.com wrote:
>>I'm not sure when it came into being, since this it the first time I
have worked very much with a password control in .NET, but if a
textbox that has a non-empty value for PasswordChar or the
UseSystemPass wordChar property is true, and the textbox has focus, if
the Caps Lock key is pressed, a warning balloon tooltip is
automatical ly displayed by the system. I cannot even find
documentati on that describes this behaviour.
There isn't any, it's a courtesy of your friendly neighborhood common
controls library. :-)
>>My question is, is there anyway to temporarily turn that off in code?
My question is, why on earth would you want to? It's saved my bacon a few
times. That said...

My company uses a third part software packe that our software
integrates with. The third part software has two methods of security,
one uses Active Directory, where the password is defiitely case
sensitive. But the password for the builtin security is not case
sensitive. That is why I would like to be able to turn it off, if the
database is configured to use the third party software security, there
is no need to warn the user that the Caps Lock key is on.
It can't hurt to warn, though, and it's very good for users to get
accustomed to the rule "passwords are case sensitive", since in most systems
they are (and in those were they aren't, they ought to be, but let's ignore
the issue of password strength for now). Unless users (or pointy-haired
bosses) actually complain that they're confused by the message, I wouldn't
go to the trouble of disabling it. Especially since the way to disable it is
a bit dubious (turning off balloon tips works, but it has the obvious
drawback of, well, turning off balloon tips, which can be used for more
purposes than caps lock warnings).

--
J.
Jul 11 '08 #4
On Jul 11, 3:49*pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
za...@construct ion-imaging.com wrote:
On Jul 11, 2:54 pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
za...@construct ion-imaging.com wrote:
I'm not sure when it came into being, since this it the first time I
have worked very much with a password control in .NET, but if a
textbox that has a non-empty value for PasswordChar or the
UseSystemPassw ordChar property is true, and the textbox has focus, if
the Caps Lock key is pressed, a warning balloon tooltip is
automaticall y displayed by the system. I cannot even find
documentatio n that describes this behaviour.
There isn't any, it's a courtesy of your friendly neighborhood common
controls library. :-)
>My question is, is there anyway to temporarily turn that off in code?
My question is, why on earth would you want to? It's saved my bacon a few
times. That said...
My company uses a third part software packe that our software
integrates with. The third part software has two methods of security,
one uses Active Directory, where the password is defiitely case
sensitive. But the password for the builtin security is not case
sensitive. That is why I would like to be able to turn it off, if the
database is configured to use the third party software security, there
is no need to warn the user that the Caps Lock key is on.

It can't hurt to warn, though, and it's very good for users to get
accustomed to the rule "passwords are case sensitive", since in most systems
they are (and in those were they aren't, they ought to be, but let's ignore
the issue of password strength for now). Unless users (or pointy-haired
bosses) actually complain that they're confused by the message, I wouldn't
go to the trouble of disabling it. Especially since the way to disable itis
a bit dubious (turning off balloon tips works, but it has the obvious
drawback of, well, turning off balloon tips, which can be used for more
purposes than caps lock warnings).
Thanks for your comment. In fact, after I mentioned this to my "pointy
head boss", that was exactly what he said to me.

No, he not really "pointed headed". :-)
Jul 11 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
4934
by: Robert | last post by:
Hi! I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not help. I have seen some example that looks at the characters entered in an input field to determine if the caps lock is on, but I was wondering if something is possible that is a bit more immediate to report the caps
4
6658
by: Peter D | last post by:
I have a second hand bar code reader (keyboard wedge) en i can read the bar codes but after every scan he turns my caps lock on. (GRRRRRR). I search a code to turn my caps lock off or can anyone tell me why (the hell)it happens that way.
3
6648
by: Mike L | last post by:
How do I turn Caps Lock on, when my form opens?
0
1640
by: fNew VBer | last post by:
Hi. I'm new to Visual Basic .NET, so you'll have to bear with me . . . I want to create an app that turns off CAPS LOCK when the SHIFT key is pressed. I got the code to turn off CAPS LOCK to work, but it only works when the program has the focus. How can I write an app that will do this while running in the background?
1
5718
by: yxq | last post by:
Hello, I have a main form, there other some controls(i.e. textbox) in the form. I want to detect whether Caps Lock key is pressed in form-key event. Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp If e.KeyCode = 20 Then MessageBox.Show("Caps Lock is pressed!") End If End Sub
1
15674
by: charlies224 | last post by:
Hi, I am writting a software that requires me to make sure the Num Lock is always on and Caps Lock is always off. First, I know how to detect if Num Lock or Caps Lock is on or off (if someone is interested, let me know and I will send you the codes). Once we know if the stat of Num Lock/ Caps Lock is not what we desired, we just send the Num Lock / Caps Lock key to change the stat. From most of
1
2438
by: Brian Parker | last post by:
I play a DirectX game and while that game is running, I would like to change the behavior of the Caps Lock key. When it's pressed, I don't want it to toggle my Caps Lock on and off, but instead send a different code instead - preferably mimicing the 4th or 5th button of a mouse being pressed. 1) Is this doable? If so... 2) What the general idea of how to approach this? TIA,
4
5095
by: zacks | last post by:
I'm not sure when it came into being, since this it the first time I have worked very much with a password control in .NET, but if a textbox that has a non-empty value for PasswordChar or the UseSystemPasswordChar property is true, and the textbox has focus, if the Caps Lock key is pressed, a warning balloon tooltip is automatically displayed by the system. I cannot even find documentation that describes this behaviour. My question is,...
1
3162
by: cmrhema | last post by:
Hi, Two questions 1. In windows application if we put on the below code, it will identify whether caps lock is on or not if (TextBox.IsKeyLocked(Keys.CapsLock)) { MessageBox.Show("caps lock on"); }
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.