Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
GeneralRe: System.io.Directory.GetFiles Pin
George Luttrell28-Feb-08 13:43
George Luttrell28-Feb-08 13:43 
GeneralTrapping a Keystroke Pin
MarkMokris27-Feb-08 6:30
MarkMokris27-Feb-08 6:30 
GeneralRe: Trapping a Keystroke Pin
Gareth H27-Feb-08 6:37
Gareth H27-Feb-08 6:37 
GeneralRe: Trapping a Keystroke Pin
MarkMokris27-Feb-08 6:42
MarkMokris27-Feb-08 6:42 
GeneralRe: Trapping a Keystroke Pin
Gareth H27-Feb-08 6:49
Gareth H27-Feb-08 6:49 
GeneralRe: Trapping a Keystroke Pin
PIEBALDconsult27-Feb-08 6:58
mvePIEBALDconsult27-Feb-08 6:58 
GeneralRe: Trapping a Keystroke Pin
Dave Kreskowiak27-Feb-08 7:04
mveDave Kreskowiak27-Feb-08 7:04 
GeneralRe: Trapping a Keystroke Pin
GuyThiebaut27-Feb-08 7:12
professionalGuyThiebaut27-Feb-08 7:12 
Use the Handled property to trap keystrokes on the KeyUp event.
On the KeyPress event you can capture the key that is pressed.


void KeyRecord_KeyUp(Object sender, KeyEventArgs e)
    {
     e.Handled = true;
    }

void KeyRecord_KeyPress(Object sender, KeyPressEventArgs e)
    {
     e.Handled = true;
     MessageBox.Show(e.KeyChar.ToString());
    } 


I hope this is of some help.

Regards

Guy

P.S. you will also need to set Handled to true in the KeyDown event.

You always pass failure on the way to success.


GeneralDateTimePicker Pin
Trustapple27-Feb-08 5:13
Trustapple27-Feb-08 5:13 
GeneralRe: DateTimePicker Pin
led mike27-Feb-08 5:21
led mike27-Feb-08 5:21 
GeneralRe: DateTimePicker Pin
Trustapple27-Feb-08 6:25
Trustapple27-Feb-08 6:25 
GeneralRe: DateTimePicker Pin
led mike27-Feb-08 6:51
led mike27-Feb-08 6:51 
GeneralRe: DateTimePicker Pin
J4amieC27-Feb-08 6:25
J4amieC27-Feb-08 6:25 
JokeRe: DateTimePicker Pin
Not Active27-Feb-08 7:22
mentorNot Active27-Feb-08 7:22 
GeneralDynamic asp Tables and AJAX issue Pin
mrarunks27-Feb-08 4:47
mrarunks27-Feb-08 4:47 
GeneralRe: Dynamic asp Tables and AJAX issue Pin
LongRange.Shooter27-Feb-08 8:13
LongRange.Shooter27-Feb-08 8:13 
Questiontrimming a string Pin
robustm27-Feb-08 4:46
robustm27-Feb-08 4:46 
GeneralRe: trimming a string Pin
Xmen Real 27-Feb-08 4:49
professional Xmen Real 27-Feb-08 4:49 
GeneralRe: trimming a string Pin
phannon8627-Feb-08 4:52
professionalphannon8627-Feb-08 4:52 
GeneralRe: trimming a string Pin
PIEBALDconsult27-Feb-08 6:53
mvePIEBALDconsult27-Feb-08 6:53 
GeneralRe: trimming a string Pin
Luc Pattyn27-Feb-08 8:12
sitebuilderLuc Pattyn27-Feb-08 8:12 
GeneralRe: trimming a string Pin
PIEBALDconsult27-Feb-08 15:50
mvePIEBALDconsult27-Feb-08 15:50 
GeneralRe: trimming a string Pin
Luc Pattyn27-Feb-08 22:37
sitebuilderLuc Pattyn27-Feb-08 22:37 
GeneralRe: trimming a string Pin
PIEBALDconsult28-Feb-08 12:05
mvePIEBALDconsult28-Feb-08 12:05 
GeneralRe: trimming a string Pin
Luc Pattyn28-Feb-08 12:25
sitebuilderLuc Pattyn28-Feb-08 12:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.