Click here to Skip to main content
15,896,915 members
Home / Discussions / C#
   

C#

 
QuestionHow to cancel any keyboard stroke? Pin
Hussam Fattahi3-Jan-07 6:16
Hussam Fattahi3-Jan-07 6:16 
AnswerRe: How to cancel any keyboard stroke? Pin
Judah Gabriel Himango3-Jan-07 6:24
sponsorJudah Gabriel Himango3-Jan-07 6:24 
GeneralRe: How to cancel any keyboard stroke? Pin
PIEBALDconsult3-Jan-07 6:42
mvePIEBALDconsult3-Jan-07 6:42 
GeneralRe: How to cancel any keyboard stroke? Pin
Judah Gabriel Himango3-Jan-07 7:24
sponsorJudah Gabriel Himango3-Jan-07 7:24 
GeneralRe: How to cancel any keyboard stroke? Pin
Hussam Fattahi3-Jan-07 8:28
Hussam Fattahi3-Jan-07 8:28 
AnswerRe: How to cancel any keyboard stroke? Pin
ednrgc3-Jan-07 6:46
ednrgc3-Jan-07 6:46 
GeneralRe: How to cancel any keyboard stroke? Pin
Dan Neely3-Jan-07 7:04
Dan Neely3-Jan-07 7:04 
AnswerRe: How to cancel any keyboard stroke? Pin
Martin#3-Jan-07 9:00
Martin#3-Jan-07 9:00 
Hello,

If its a windows application, you could use the KeyDown event of the Form and check the Keys.

For example Alt+F4:

//Costructor code
this.KeyPreview = true;    
this.KeyDown += new KeyEventHandler(CheckKeys);

private void CheckKeys(object sender, KeyEventArgs e)
{
    if (e.Alt && e.KeyCode == Keys.F4)
        e.Handled = true;
}


Hope that helps!

All the best,

Martin
GeneralRe: How to cancel any keyboard stroke? Pin
Hussam Fattahi3-Jan-07 9:14
Hussam Fattahi3-Jan-07 9:14 
GeneralRe: How to cancel any keyboard stroke? Pin
Martin#3-Jan-07 9:39
Martin#3-Jan-07 9:39 
GeneralRe: How to cancel any keyboard stroke? Pin
Hussam Fattahi3-Jan-07 10:11
Hussam Fattahi3-Jan-07 10:11 
AnswerRe: How to cancel any keyboard stroke? Pin
Daniel Grunwald3-Jan-07 9:10
Daniel Grunwald3-Jan-07 9:10 
GeneralRe: How to cancel any keyboard stroke? Pin
Pete O'Hanlon3-Jan-07 9:15
mvePete O'Hanlon3-Jan-07 9:15 
GeneralRe: How to cancel any keyboard stroke? Pin
lost in transition 4-Jan-07 11:09
lost in transition 4-Jan-07 11:09 
AnswerDisabling cntrl + alt + del in Windows Pin
Ennis Ray Lynch, Jr.3-Jan-07 15:28
Ennis Ray Lynch, Jr.3-Jan-07 15:28 
QuestionString chopping Pin
Sam Heller3-Jan-07 5:56
Sam Heller3-Jan-07 5:56 
AnswerRe: String chopping Pin
Judah Gabriel Himango3-Jan-07 6:03
sponsorJudah Gabriel Himango3-Jan-07 6:03 
GeneralRe: String chopping Pin
Sam Heller3-Jan-07 6:08
Sam Heller3-Jan-07 6:08 
GeneralRe: String chopping Pin
Judah Gabriel Himango3-Jan-07 6:14
sponsorJudah Gabriel Himango3-Jan-07 6:14 
GeneralRe: String chopping Pin
led mike3-Jan-07 6:09
led mike3-Jan-07 6:09 
GeneralRe: String chopping Pin
Judah Gabriel Himango3-Jan-07 6:19
sponsorJudah Gabriel Himango3-Jan-07 6:19 
QuestionStart Open File Dialog in Thumbnail View Pin
dbrenth3-Jan-07 5:54
dbrenth3-Jan-07 5:54 
Questionlogin page problam Pin
dhakera3-Jan-07 5:26
dhakera3-Jan-07 5:26 
AnswerRe: login page problam Pin
Tyler453-Jan-07 5:38
Tyler453-Jan-07 5:38 
GeneralRe: login page problam Pin
Tyler453-Jan-07 5:42
Tyler453-Jan-07 5:42 

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.