Results 1 to 3 of 3

Thread: Event vs Enter Key

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    261

    Event vs Enter Key

    I think this is an easy Q, but I can't figure it out.... I have a button on a page that executes a query, and turns off a label. It works fine, when I click it. But if I hit the enter key I get the same query, BUT the label does not disappear. How do I identify hitting the enter key as an event?

  2. #2
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: Event vs Enter Key

    KeyDown Event

    If (e.KeyCode == Keys.Enter)
    {
    Delicious..
    }

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Event vs Enter Key

    It sounds like your logic is scattered.

    Put the application logic which hides the label in a single method. Call this method from any event handlers that trigger the logic process.

    You should never put application logic in event handlers. Only interface logic and calls to application logic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width