Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I am currently in a college coarse and need help with a problem. I am trying to make it so that when (physically) press enter while being in a text it will create a msgbox(""). I have everything working except for the fact that I can't find a way to make enter become a trigger for an action. Please help
  • Leaders
Posted

What have you tried? Are you handling the KeyDown event of the textbox? This seems to do the trick for me with both a multi-line and single-line textbox:

Private Sub textbox2_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles textbox2.KeyDown
   If (e.KeyCode = Keys.Enter) Then
       MessageBox.Show(textbox2.Text)
   End If
End Sub

[sIGPIC]e[/sIGPIC]
  • 2 weeks later...

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...