Click here to Skip to main content
16,006,013 members
Home / Discussions / C#
   

C#

 
GeneralRe: Paint Application in C# Pin
jijophilip29-Mar-08 17:55
jijophilip29-Mar-08 17:55 
GeneralRe: Paint Application in C# Pin
MarkB77729-Mar-08 18:21
MarkB77729-Mar-08 18:21 
General"Shift" key Pin
jon-8029-Mar-08 9:22
professionaljon-8029-Mar-08 9:22 
GeneralRe: "Shift" key Pin
Luc Pattyn29-Mar-08 10:31
sitebuilderLuc Pattyn29-Mar-08 10:31 
GeneralRe: "Shift" key Pin
jon-8029-Mar-08 11:13
professionaljon-8029-Mar-08 11:13 
GeneralRe: "Shift" key Pin
Luc Pattyn29-Mar-08 11:19
sitebuilderLuc Pattyn29-Mar-08 11:19 
GeneralRe: "Shift" key [modified] Pin
jon-8029-Mar-08 21:16
professionaljon-8029-Mar-08 21:16 
GeneralRe: "Shift" key Pin
Luc Pattyn30-Mar-08 0:43
sitebuilderLuc Pattyn30-Mar-08 0:43 
Hi Jon,


jon_80 wrote:
//does not work


that is no information. does it compile? does it generate a compile-time error?
if so, which one? does it generate a run-time error? if so, which one? does it
cause a computer melt-down? what?

I repeat: read the documentation

1. on KeyPressed event it says: The KeyPress event is not raised by noncharacter keys;
however, the noncharacter keys do raise the KeyDown and KeyUp events.

so why would you do your messy shift test in keyPressed()?

2. on KeyPressed event: there is a KeyPressEventArgs with a KeyChar property, which
holds the VALUE of the effective key or key combination

3. on KeyDown event it offers a KeyEventArgs which has a Shift property

4. on Control.ModifierKeys Property: Gets a value indicating which of the modifier keys
(SHIFT, CTRL, and ALT) is in a pressed state.

So the only real problem is you have to choose one of many good ways...

AND AGAIN: stop abusing the PRE tags; do you ever reread your post, and check it looks
the way you intended?

this probably was my last reply on this thread.

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: "Shift" key Pin
Pete O'Hanlon30-Mar-08 10:25
mvePete O'Hanlon30-Mar-08 10:25 
GeneralRe: "Shift" key Pin
Luc Pattyn30-Mar-08 10:37
sitebuilderLuc Pattyn30-Mar-08 10:37 
GeneralRe: "Shift" key Pin
Pete O'Hanlon30-Mar-08 10:52
mvePete O'Hanlon30-Mar-08 10:52 
GeneralSQL query in c# Pin
Yevgeny Efter29-Mar-08 6:30
Yevgeny Efter29-Mar-08 6:30 
GeneralRe: SQL query in c# Pin
Giorgi Dalakishvili29-Mar-08 7:12
mentorGiorgi Dalakishvili29-Mar-08 7:12 
GeneralRe: SQL query in c# Pin
Yevgeny Efter29-Mar-08 7:17
Yevgeny Efter29-Mar-08 7:17 
GeneralRe: SQL query in c# Pin
Giorgi Dalakishvili29-Mar-08 7:22
mentorGiorgi Dalakishvili29-Mar-08 7:22 
GeneralRe: SQL query in c# Pin
Yevgeny Efter29-Mar-08 7:31
Yevgeny Efter29-Mar-08 7:31 
GeneralRe: SQL query in c# Pin
User 665829-Mar-08 7:55
User 665829-Mar-08 7:55 
GeneralRe: SQL query in c# Pin
Yevgeny Efter29-Mar-08 8:13
Yevgeny Efter29-Mar-08 8:13 
GeneralRe: SQL query in c# Pin
Luis Alonso Ramos29-Mar-08 12:34
Luis Alonso Ramos29-Mar-08 12:34 
GeneralRe: SQL query in c# Pin
Yevgeny Efter30-Mar-08 0:13
Yevgeny Efter30-Mar-08 0:13 
GeneralRe: SQL query in c# Pin
Luis Alonso Ramos30-Mar-08 1:04
Luis Alonso Ramos30-Mar-08 1:04 
GeneralRe: SQL query in c# Pin
Yevgeny Efter30-Mar-08 6:00
Yevgeny Efter30-Mar-08 6:00 
GeneralMicrosoft Windows Software Development Kit Pin
BlitzPackage29-Mar-08 4:47
BlitzPackage29-Mar-08 4:47 
GeneralRe: Microsoft Windows Software Development Kit Pin
Colin Angus Mackay29-Mar-08 5:33
Colin Angus Mackay29-Mar-08 5:33 
Generalmodeling tool OnPaint Pin
Gareth H29-Mar-08 4:15
Gareth H29-Mar-08 4:15 

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.