Hey all,

Is there a way that I can detect when any key has been pressed?

Basically I have a login box and if the user has Caps Lock on and tries to enter his password a Tooltip apears, however as soon as they type again I want the tool tip to disappear. Is there away i can detect the user has hit a key??

Thanks

yes you can do it in the forms keypress event. Are you working with windows application or console applications. if its windows then u can fine Forms-> KeyPress Event or search it in msdn library

If your using .NET 3.5 you won't have to worry about the Caps lock being on as a warning is shown automatically for you! (I think this will only work if you have set the UseSystemPasswordChar attribute to True, this will only take effect after your project has been published i.e: not in design/run time).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.