Form KeyDown Problem

R

Rasika WIJAYARATNE

I have a form with a KeyDown event handler method attached to it. It
has three text boxes and two buttons (buttons are attached to event
handler). However when I debug, the form opens with the first text box
focussed, and when I press enter the Win XP 'Default Beep' sound plays
but does not fire the event handler (doesn't hit the break point inside
it). The event handler is definitely wired up to the form control, does
anyone know why this happens? Winforms using C++/CLI on .NET FW 2.0,
using Visual C++ Express for .NET 2.0.

Rasika.

I haven't set Form.AcceptButton or Form.CancelButton.
 
G

Guest

Rasika... I suspect the event is text changed or something like that so if
you just hit return the text has not changed.
 
R

Rasika WIJAYARATNE

The problem was the first textbox was focussed, so it wasn't firing the
form's keydown event handler. It worked for another form which is why I
couldn't figure out why it didnt work for this form, the reason they
other form worked was because it had a tab control and the tab was
focussed on form load, rather than a a text box. Thank you for you
feedback, it helped me to track this problem down.

Rasika.
 

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