Using CAPSLOCK status in StatusBarPanel
-
I m using a status bar in the form. In one of the panels of the status bar, I just want set the status of the CAPSLOCK & NUMLOCK, the same way it can be done in VB. But in VB the panel properties has different display value, so it was easy. How this can be achieved in C#???:confused: Thanks in advance...:)
Regards SG (sgg245@yahoo.co.in)
-
I m using a status bar in the form. In one of the panels of the status bar, I just want set the status of the CAPSLOCK & NUMLOCK, the same way it can be done in VB. But in VB the panel properties has different display value, so it was easy. How this can be achieved in C#???:confused: Thanks in advance...:)
Regards SG (sgg245@yahoo.co.in)
The properties Console.CapsLock and Console.NumberLock provide the necessary information. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
The properties Console.CapsLock and Console.NumberLock provide the necessary information. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
Thanks so much. Its working. But stil a prob. This is when the application start it detects if the CAPSLOCK is ON then I can display certain msg or so... But I want whenever CAPSLOCK button is pressed then it should update the status of the panel in the status bar. If CAPSLOCK is ON then status bar panel should show ON. If CAPSLOCK is toggled i.e. OFF then status bar panel should show OFF. Something like this... Thanks in Advance...;):);)
Regards SG (sgg245@yahoo.co.in)
-
Thanks so much. Its working. But stil a prob. This is when the application start it detects if the CAPSLOCK is ON then I can display certain msg or so... But I want whenever CAPSLOCK button is pressed then it should update the status of the panel in the status bar. If CAPSLOCK is ON then status bar panel should show ON. If CAPSLOCK is toggled i.e. OFF then status bar panel should show OFF. Something like this... Thanks in Advance...;):);)
Regards SG (sgg245@yahoo.co.in)
Hi, there are at least two ways to keep your status bar up-to-date: 1. on your form, set KeyPreview true; then add an event handler for KeyDown; the handler now will fire for every key moving down; in the handler check for Keys.CapsLock; if it is, use Keyboard.CapsLock and update the status bar; don't try to count the toggles yourself ! 2. on your form, add a Windows.Forms.Timer and let it fire say every second; in its Tick handler read Keyboard.CapsLock and update status bar. The choice is yours, it depends a bit on which of those handlers you may already have for some other reason. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
Hi, there are at least two ways to keep your status bar up-to-date: 1. on your form, set KeyPreview true; then add an event handler for KeyDown; the handler now will fire for every key moving down; in the handler check for Keys.CapsLock; if it is, use Keyboard.CapsLock and update the status bar; don't try to count the toggles yourself ! 2. on your form, add a Windows.Forms.Timer and let it fire say every second; in its Tick handler read Keyboard.CapsLock and update status bar. The choice is yours, it depends a bit on which of those handlers you may already have for some other reason. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
Thanks very much. I anticipated something like we used to do in VB status bar panels... Anyways, again thanks for ur help... so kind of u...:-D
Regards SG (sgg245@yahoo.co.in)
-
Thanks very much. I anticipated something like we used to do in VB status bar panels... Anyways, again thanks for ur help... so kind of u...:-D
Regards SG (sgg245@yahoo.co.in)
You're welcome. Come to think of it, I would prefer the timer approach; with key events, if your app looses focus, capslock gets toggles, app gets focus back, you will not know about the change (unless you add code to some other events too, such as Activate). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google