ENTER KEYPRES

  • Thread starter Thread starter John Baro
  • Start date Start date
J

John Baro

Wont answer your post if you x-post to this many newsgroups.
A fair few people actually block posts that are x-posted to too many
newsgroups as this is sometimes a tactic that spammers use.
Your first question is easy in vb6 but I would have to see if the same works
in .NET.
As for your second question I can tell you exactly how to do that if you
care to not x-post.
Cheers
Newsgroup Nazi
 
Please post to the appropriate groups only!!
How can I disable a beep when I press Enter on TexBox
I'm trying this but it don't work:

I do it in KeyDown event

If e.KeyCode = Windows.Forms.Keys.Enter Then
' Do something ...
e.Handled = True
End If

The beep isn't created because you hold down the Enter key but because
chr(13) is received and is "of no use" for the textbox. Ctr+M also creates
chr(13) but is not the enter key. Handle the KeyPress event instead:

If e.KeyChar = Chr(13) Then
e.Handled = True
End If



That's not standard behavior, but if you need it, call the SelectNextControl
of the control. In *keydown*:

If e.KeyCode = Windows.Forms.Keys.Enter Then
e.Handled = True
directcast(sender, control).selectnextcontrol(...)
End If



--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
How can I disable a beep when I press Enter on TexBox
I'm trying this but it don't work:

I do it in KeyDown event

If e.KeyCode = Windows.Forms.Keys.Enter Then
' Do something ...
e.Handled = True
End If
 
Hi,

Despite the other message, please keep crossposting and go not to
multiposting.
However it is a little bit to much to send a message to a C# group for
VB.net code.

You can try this, normaly Armin puts this code in this newsgroup, however
when he sees a message with so many C# he maybe will not answer, he is very
strict in that.

I hope this helps?

Cor

\\\
Private Sub TextBox1_KeyPress( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles TextBox1.KeyPress
If e.KeyChar = vbCr Then
e.Handled = True
End If
End Sub
///
 
msnews.microsoft.com said:
How can I disable a beep when I press Enter on TexBox
I'm trying this but it don't work:

I do it in KeyDown event

If e.KeyCode = Windows.Forms.Keys.Enter Then
' Do something ...
e.Handled = True
End If

don't know this one, probably error related.
Also can anyone tell me a good idea about this:
I want to do that when I press Enter on TextBox the focus must get second
TextBox and so on...

You can do this:

private void MyTextBox_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SendKeys.Send("{TAB}");
}
}

FB
 
Cor Ligthert said:
You can try this, normaly Armin puts this code in this newsgroup,
however when he sees a message with so many C# he maybe will not
answer, he is very strict in that.

Not necessary to make a discussion about me in your answer, don't you think
so?
 
I did want to answer this, because of the crossposting and it is normaly
your code.

That was the only reason.

Cor
 
Cor Ligthert said:
I did want to answer this, because of the crossposting and it is
normaly your code.

That was the only reason.

I don't like that you post "he is very strict in that" about me to several
groups.
 
Hi Armin,

Sorry, do not do that anymore, however there is nothing meant wrong with.

Cor
 
* "msnews.microsoft.com" <[email protected]> scripsit:
[...]

I remember I saw this question somewhere else.

Please stop posting English language questions to non-English groups.
 
Armin,

Good to see you back. Hadn't seen you post in a while.

By the way has anybody heard from Fergus?
 
Back
Top