mhrappstead Posted November 30, 2006 Posted November 30, 2006 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 Quote
Leaders snarfblam Posted November 30, 2006 Leaders Posted November 30, 2006 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 Quote [sIGPIC]e[/sIGPIC]
anthony Posted December 12, 2006 Posted December 12, 2006 That should do it.Actually Im mainly replying to this thread to test an application of my own. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.