Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

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

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.
1 Solution
Bob LearnedCommented:
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)

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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