Pressing Enter on a button in a user control

  • Thread starter Vijayakrishna Pondala
  • Start date
V

Vijayakrishna Pondala

Hi,
If I press 'ENTER', when the focus is on a button in a form, the buttons
Click event fires but pressing 'ENTER' when the focus is on a button in a
user control doesn't fire the Click event of the button. Why? Pressing
<SPACE BAR> works fine with both.
Help!!!!
Regards,
Pondala Vijaya Krishna.
 
H

Herfried K. Wagner [MVP]

Hello,

Vijayakrishna Pondala said:
If I press 'ENTER', when the focus is on a button in a form,
the buttons Click event fires but pressing 'ENTER' when the
focus is on a button in a user control doesn't fire the Click
event of the button. Why? Pressing <SPACE BAR>
works fine with both.

I am not able to provide a solution but I am able to reproduce the problem
using .NET 1.0. Which version of .NET do you use?

Regards,
Herfried K. Wagner
 
V

VIJAYAKRISHNA PONDALA

I am using version 1.0.
I am able to solve the problem by handling the KeyPress event on the
buttons in user control, but just wanted to know why this happens.

Thanks,
Vijaya Krishna Pondala.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top