if (e.KeyChar == 13)

Posted on 2012-08-24
Last Modified: 2012-08-24
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?
Question by:allelopath
    LVL 22

    Accepted Solution

    LVL 22

    Expert Comment

    LVL 1

    Author Comment

    if (e.KeyChar.Equals(Keys.Return)) {

    Open in new window

    LVL 22

    Assisted Solution

    you will have to cast it to int since it is an enum



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    Title # Comments Views Activity
    c# can't call wbemtest.exe 22 25
    Poor Man's .NET Framework Certification 2 27
    Change to event 1 47
    Handling arrays 14 27
    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now