Click here to Skip to main content
15,511,503 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hide a Panel on MDI Container Pin
Eddy Vluggen17-Jul-15 12:59
professionalEddy Vluggen17-Jul-15 12:59 
QuestionComplexity Pin
Gilbert Consellado16-Jul-15 23:37
professionalGilbert Consellado16-Jul-15 23:37 
AnswerRe: Complexity Pin
Godhaniketan17-Jul-15 1:07
professionalGodhaniketan17-Jul-15 1:07 
GeneralRe: Complexity Pin
Gilbert Consellado17-Jul-15 3:15
professionalGilbert Consellado17-Jul-15 3:15 
AnswerRe: Complexity Pin
Pete O'Hanlon17-Jul-15 2:07
mvaPete O'Hanlon17-Jul-15 2:07 
GeneralRe: Complexity Pin
Gilbert Consellado17-Jul-15 3:17
professionalGilbert Consellado17-Jul-15 3:17 
GeneralRe: Complexity Pin
Gilbert Consellado17-Jul-15 6:18
professionalGilbert Consellado17-Jul-15 6:18 
AnswerRe: Complexity PinPopular
Alan N17-Jul-15 5:37
Alan N17-Jul-15 5:37 
Off topic with regards to your question but is your key testing code correct?

I assume the intention of the following code is to allow A or Alt-A
C#
if ((e.KeyCode == Keys.A || (e.Alt && e.KeyCode == Keys.A))

The first condition does not test for modifier keys so would be true for A with any combination of modifiers keys (including none). Due to shortcut evaluation the second condition will be evaluated only if the first is false, that is if the Key is NOT A and I'm sure you can see the problem with that. Even if it was evaluated the condition does not exclude additional modifiers so Ctrl-Alt-A would be allowed.

The solution is to test the key and the modifiers separately. Specifically the modifiers test should be for none or just Alt.
C#
if ((e.KeyCode == Keys.A) && (e.Modifiers == Keys.None || e.Modifiers == Keys.Alt))


Hope that helps, Alan.
GeneralRe: Complexity Pin
Gilbert Consellado17-Jul-15 6:22
professionalGilbert Consellado17-Jul-15 6:22 
QuestionPass Anonymous Type To Worker Pin
Kevin Marois16-Jul-15 13:58
professionalKevin Marois16-Jul-15 13:58 
AnswerRe: Pass Anonymous Type To Worker Pin
Dave Kreskowiak16-Jul-15 15:49
mveDave Kreskowiak16-Jul-15 15:49 
GeneralRe: Pass Anonymous Type To Worker Pin
Kevin Marois16-Jul-15 15:52
professionalKevin Marois16-Jul-15 15:52 
AnswerRe: Pass Anonymous Type To Worker Pin
F-ES Sitecore16-Jul-15 22:45
professionalF-ES Sitecore16-Jul-15 22:45 
Questionform 1 and form 2 Pin
jamesmc153516-Jul-15 5:08
jamesmc153516-Jul-15 5:08 
AnswerRe: form 1 and form 2 Pin
Wes Aday16-Jul-15 5:26
professionalWes Aday16-Jul-15 5:26 
Questioni get a error invalid expresion Pin
jamesmc153516-Jul-15 3:57
jamesmc153516-Jul-15 3:57 
AnswerRe: i get a error invalid expresion Pin
Richard MacCutchan16-Jul-15 4:02
mveRichard MacCutchan16-Jul-15 4:02 
GeneralRe: i get a error invalid expresion Pin
jamesmc153516-Jul-15 4:09
jamesmc153516-Jul-15 4:09 
GeneralRe: i get a error invalid expresion Pin
Richard MacCutchan16-Jul-15 5:54
mveRichard MacCutchan16-Jul-15 5:54 
GeneralRe: i get a error invalid expresion Pin
jamesmc153516-Jul-15 5:56
jamesmc153516-Jul-15 5:56 
GeneralRe: i get a error invalid expresion Pin
Richard MacCutchan16-Jul-15 5:58
mveRichard MacCutchan16-Jul-15 5:58 
GeneralRe: i get a error invalid expresion Pin
jamesmc153516-Jul-15 6:00
jamesmc153516-Jul-15 6:00 
GeneralRe: i get a error invalid expresion Pin
Richard MacCutchan16-Jul-15 6:06
mveRichard MacCutchan16-Jul-15 6:06 
Questionhelp with login Pin
jamesmc153516-Jul-15 3:49
jamesmc153516-Jul-15 3:49 
AnswerRe: help with login Pin
Richard MacCutchan16-Jul-15 3:59
mveRichard MacCutchan16-Jul-15 3:59 

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.