By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

Moving Focus

P: n/a
I am capturing the KeyPress event on a series of text boxes and checking for
the presence of the CR character to move the focus to the next textbox in
tab order. I'm able to do this using the focus method of the textbox, but
even though the focus changes when the CR character is pressed, I still get
a "beep" from the textbox where the focus was when enter was pressed. Is
there any way to turn that off?

Bob
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try modify the Handled property of the event arguments. For sample:

Private Sub MyControl_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
'(...) your code
e.Handled = True 'this do the key don't process after leave the
procedure
'(...) your code
End Sub
--
[]s
Cesar
Carsoft Consultoria e Sistemas
www.carsoftnet.com.br


"Robert Boudra" <rb*****@comcast.net> escreveu na mensagem
news:OT**************@TK2MSFTNGP15.phx.gbl...
I am capturing the KeyPress event on a series of text boxes and checking for
the presence of the CR character to move the focus to the next textbox in
tab order. I'm able to do this using the focus method of the textbox, but
even though the focus changes when the CR character is pressed, I still get
a "beep" from the textbox where the focus was when enter was pressed. Is
there any way to turn that off?

Bob
Nov 21 '05 #2

P: n/a
Bob,

Try to use the keyup event for getting the key values in future and use the
keypress only to handle that beep as Cesar showed you.

I hope this helps,

Cor

"Robert Boudra" <rb*****@comcast.net> schreef in bericht
news:OT**************@TK2MSFTNGP15.phx.gbl...
I am capturing the KeyPress event on a series of text boxes and checking
for the presence of the CR character to move the focus to the next textbox
in tab order. I'm able to do this using the focus method of the textbox,
but even though the focus changes when the CR character is pressed, I still
get a "beep" from the textbox where the focus was when enter was pressed.
Is there any way to turn that off?

Bob

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.