• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 988
  • Last Modified:

if (e.KeyChar == 13)

I came across this line of code:
if (e.KeyChar == 13)

Open in new window

The 13 is carriage return. Is the a C# constant define for this?
0
allelopath
Asked:
allelopath
  • 3
2 Solutions
 
p_davisCommented:
Keys.Return
0
 
p_davisCommented:
System.Windows.Forms.Keys.Return
0
 
allelopathAuthor Commented:
if (e.KeyChar.Equals(Keys.Return)) {

Open in new window

0
 
p_davisCommented:
you will have to cast it to int since it is an enum

or

Keys.Return.GetIntValue()
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now