Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Pressing Enter on a textbox

Pressing Enter on a textbox

Scheduled Pinned Locked Moved Visual Basic
questionalgorithmshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    johncassell
    wrote on last edited by
    #1

    Hello, I'm sorry for asking such a basic question but I cannot find the answer to it by searching any forums.. All I need is to be able to do something simple like make a msbgox pop up when the user clicks enter on a text box. Basically a user will type a number in the textbox and then a pop up box will appear showing the number they have just typed. Could someone help me with this please? Thanks John C

    K M 2 Replies Last reply
    0
    • J johncassell

      Hello, I'm sorry for asking such a basic question but I cannot find the answer to it by searching any forums.. All I need is to be able to do something simple like make a msbgox pop up when the user clicks enter on a text box. Basically a user will type a number in the textbox and then a pop up box will appear showing the number they have just typed. Could someone help me with this please? Thanks John C

      K Offline
      K Offline
      Keith Malwitz
      wrote on last edited by
      #2

      There are several possible ways to do this, depending on your needs. You could use the "Leave" event of the textbox to popup your messagebox when the control loses focus (either by pressing enter, tab, or clicking the mouse on another control). If you only want the popup to occur when the enter key is pressed, you should use the textbox control's "Keypress" event to check whether the key pressed was the return key, and run your popup code if it was. Hope this helps.

      1 Reply Last reply
      0
      • J johncassell

        Hello, I'm sorry for asking such a basic question but I cannot find the answer to it by searching any forums.. All I need is to be able to do something simple like make a msbgox pop up when the user clicks enter on a text box. Basically a user will type a number in the textbox and then a pop up box will appear showing the number they have just typed. Could someone help me with this please? Thanks John C

        M Offline
        M Offline
        Member_3269611
        wrote on last edited by
        #3

        Hi, I think the following code will fulfill your requirement. TextBox1_KeyPress ----------------- If Asc(e.KeyChar) = 13 Then MsgBox("The Data You Have Entered : " & TextBox1.Text, MsgBoxStyle.Information) End If With Regards, Pandian S

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups