Is there any equivalent Forms AcceptButton in the .Net Compact Framework?

Posted on 2006-04-24
Last Modified: 2008-02-01
Hi. I know you can set the AcceptButton in the .Net Framework to let a button be processed when the user hits "Enter."  The compact framework does not have this property on its Form class.  How can the compact framework do the equivalent of the AcceptButton?  Thanks.
Question by:mromeo
    LVL 96

    Accepted Solution

    Something like this:

      protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs e)
        if (e.KeyCode == Keys.Enter)
          button1_Click(this.button1, EventArgs.Empty);

      private void button1_Click(object sender, System.EventArgs e)


    Author Comment

    I kinda figured I'd have to do something like this.  Ok, thanks for the help.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    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…

    754 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

    16 Experts available now in Live!

    Get 1:1 Help Now