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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to auto-fill a textbox?

how to auto-fill a textbox?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
5 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.
  • L Offline
    L Offline
    Lisana
    wrote on last edited by
    #1

    hello, is there anyone know how to auto-fill a textbox? I have 4 textbox, first_name, middle_name, last_name, and full_name, I want the full_name textbox to be auto-filled when the first_name, middle_name, and last_name entered, so user doesn't need to fill in the full_name textbox. any idea to do this? thanks. Lisa

    D J 2 Replies Last reply
    0
    • L Lisana

      hello, is there anyone know how to auto-fill a textbox? I have 4 textbox, first_name, middle_name, last_name, and full_name, I want the full_name textbox to be auto-filled when the first_name, middle_name, and last_name entered, so user doesn't need to fill in the full_name textbox. any idea to do this? thanks. Lisa

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Handle the TextChanged events of the 3 text boxes, you could even do this with a single function. Combine the contents of the 3 text boxes and place the result in the FullName textbox.

      Private Sub NameTextBoxesChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FirstName.TextChanged, MiddleName.TextChanged, LastName.TextChanged
      FullName.Text = LastName.Text & ", " & FirstName.Text & " " & MiddleName.Text
      End Sub

      RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • L Lisana

        hello, is there anyone know how to auto-fill a textbox? I have 4 textbox, first_name, middle_name, last_name, and full_name, I want the full_name textbox to be auto-filled when the first_name, middle_name, and last_name entered, so user doesn't need to fill in the full_name textbox. any idea to do this? thanks. Lisa

        J Offline
        J Offline
        Joe Cleland
        wrote on last edited by
        #3

        In VB.Net this should work (code is untested): Private Sub Textbox_TextChanged(Sender as Object, e as EventArgs) Handles first_name.TextChanged, middle_name.TextChanged, last_name.TextChanged full_name.Text = first_name.Text & " " & middle_name.Text & " " & last_name.Text End Sub

        D 1 Reply Last reply
        0
        • J Joe Cleland

          In VB.Net this should work (code is untested): Private Sub Textbox_TextChanged(Sender as Object, e as EventArgs) Handles first_name.TextChanged, middle_name.TextChanged, last_name.TextChanged full_name.Text = first_name.Text & " " & middle_name.Text & " " & last_name.Text End Sub

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Ummm... and this is different from what I posted, how? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          J 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Ummm... and this is different from what I posted, how? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            J Offline
            J Offline
            Joe Cleland
            wrote on last edited by
            #5

            :-OSomehow I missed your post. Sorry about that.

            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