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. how to get value of one textbox from one form to another in VB.NET?

how to get value of one textbox from one form to another in VB.NET?

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
2 Posts 2 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.
  • D Offline
    D Offline
    drmzunlimited
    wrote on last edited by
    #1

    can anybody tell me how to get value of a textbox of form1.vb into textbox of form2.vb in Vb.net. ex : I have two forms form1.vb and form2.vb both are having one textbox each then i put some value into textbox of form1.vb and then I load form2.vb and into that loading event I added Form2_load() form2.textbox1.text = form1.textbox1.text end sub plz tell me how to do that. --waiting for a quick reply Aakash

    N 1 Reply Last reply
    0
    • D drmzunlimited

      can anybody tell me how to get value of a textbox of form1.vb into textbox of form2.vb in Vb.net. ex : I have two forms form1.vb and form2.vb both are having one textbox each then i put some value into textbox of form1.vb and then I load form2.vb and into that loading event I added Form2_load() form2.textbox1.text = form1.textbox1.text end sub plz tell me how to do that. --waiting for a quick reply Aakash

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      drmzunlimited, Keep in mind there are many ways to do this. When I did this I created two forms, a textbox on each and a button on form1 to invoke this action, the click event of the button looks like this:

      Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      
          Dim a As String
          Dim b As Form2
          b = New Form2()
      
          a = Me.TextBox1.Text.ToString
          b.TextBox1.Text = a.ToString
      
          b.Show()
      
      
      End Sub
      

      :) Nick Parker
      The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill


      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