Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a form with several buttons on it, and I created a typical case select function to handle keypress events. In order to get the keypresses to be picked up when I ran the program, I added a handler for form1.keypress and pointed it to my function.

 

I soon found out that if I clicked on any button on the form, keypress events would break... so I ended up adding handlers for every button (button1.keypres, etc) and pointed them all the the keypress case select function as well.

 

I'm wondering if there's a different way to handle this? As I continued to create my program... the handlers I added for each button.keypress broke, because keypresses when a button is selected are not being picked up.

 

I'm hoping there's a better way. Any help would be appreciated!

Posted

Already using that...

 

I'm already doing that.

 

What I was trying to say up above, is that while I already have handlers in place for the btn.keypresses, along with the form.keypress, if I disable the button after it's been clicked on... it seems that neither the form or the button has focus - so I can't find a way to catch keypresses any more after than.

 

I guess what I'm looking for is a universal way to catch keypresses, regardless of focus... or a way to change the focus back to the main form (which I could then use at the end of any button click action).

 

-Falcon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...