|
-
Feb 21st, 2013, 11:15 AM
#1
Re: How to add Keydown under all circumstances
The + is a risky operator. How it works depends on a few factors. If you have Option Strict ON, as you should, the behavior should always be predictable, but if you have Option Strict OFF, the behavior becomes situational. Aside from that AndAlso is going to have better performance in all circumstances, regardless of whether + works as you want it to. The reason for this is that AndAlso allows the code to short-circuit the whole test. + will concatenate things, which is not fast to begin with, but both pieces have to be evaluated. The way dday wrote it, if e.Control is false, it doesn't even bother evaluating the rest of the condition, since the truth of the whole condition is already known.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|