|
-
Feb 16th, 2003, 09:13 PM
#1
Thread Starter
Hyperactive Member
Annoying 'Beep' in a textbox
I have it so i can recognise when the Enter key is pressed inside a text box, but how do I stop the annoying beep?
Last edited by RealNickyDude; Feb 16th, 2003 at 09:17 PM.
-
Feb 16th, 2003, 10:15 PM
#2
Sleep mode
for me it's working ,
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If (Asc(e.KeyChar())) = 13 Then
e.Handled = True
End If
End Sub
-
Feb 17th, 2003, 06:55 AM
#3
Lively Member
Yeah, this works for me too without the beep. Just a slightly different way of doing it compared to the other one.
Code:
Private Sub txtDataFormat_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtDataFormat.KeyPress
'Ceck if enter was pressed
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
e.Handled = True
'Is this textbox active or not?
If (Me.txtDisplay.Enabled = True) Then
'Ok go here then
Me.txtDisplay.Focus()
Else
'No it's not so move to the command button instead
Me.cmdClose.Focus()
End If
End If
End Sub
-
Feb 17th, 2003, 02:29 PM
#4
Sleep mode
Your way is good if you are moving focus to other control otherwise it's as same as mine
-
Feb 17th, 2003, 04:03 PM
#5
Sleep mode
Nicky is your textbox set to multilines ?If so , then you would be in trouble I guess
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|