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. Getting Values From another Form dialog

Getting Values From another Form dialog

Scheduled Pinned Locked Moved Visual Basic
helpquestion
5 Posts 4 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hello All, I have one form name Form1 and from Form1 i have declared as follws ------------------------------- Private frm2 as new Form2 frm2.showdialog(Me) ------------------------- Now frm2 open and get some values in textboxes,in my case i want to retun back this values to previous Form's Datagrid ,(means Form1's Datagrid) for displaying, How can i solve this,anybody can help me will be appreciated:zzz:

    S A M C 4 Replies Last reply
    0
    • A Anonymous

      Hello All, I have one form name Form1 and from Form1 i have declared as follws ------------------------------- Private frm2 as new Form2 frm2.showdialog(Me) ------------------------- Now frm2 open and get some values in textboxes,in my case i want to retun back this values to previous Form's Datagrid ,(means Form1's Datagrid) for displaying, How can i solve this,anybody can help me will be appreciated:zzz:

      S Offline
      S Offline
      sumit21
      wrote on last edited by
      #2

      u can do it first strore the values in some global vaiable. for that u can make a module. therefore that values will be accessible to all forms then u can use those values in ur datagrid

      1 Reply Last reply
      0
      • A Anonymous

        Hello All, I have one form name Form1 and from Form1 i have declared as follws ------------------------------- Private frm2 as new Form2 frm2.showdialog(Me) ------------------------- Now frm2 open and get some values in textboxes,in my case i want to retun back this values to previous Form's Datagrid ,(means Form1's Datagrid) for displaying, How can i solve this,anybody can help me will be appreciated:zzz:

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Add new module to the project and there declare public variable (Public Value As Integer). Then You can use this variable in form1 and form2, as well. David

        1 Reply Last reply
        0
        • A Anonymous

          Hello All, I have one form name Form1 and from Form1 i have declared as follws ------------------------------- Private frm2 as new Form2 frm2.showdialog(Me) ------------------------- Now frm2 open and get some values in textboxes,in my case i want to retun back this values to previous Form's Datagrid ,(means Form1's Datagrid) for displaying, How can i solve this,anybody can help me will be appreciated:zzz:

          M Offline
          M Offline
          Mohamed Ishak
          wrote on last edited by
          #4

          you can do one thing First you declare the friend or public variable in then you cn call us follows In form1 Write as follows dim frm as new Form2 frm.Showdialog(Me) me.DataGrid = frm.PublicVarDataTable In Form2 Public PublicVarDataTable as datatable OkBut_Click() // add rows in table Me.DialogResult=ok Me.Hide End sub I hope this helps:laugh: Ishak

          1 Reply Last reply
          0
          • A Anonymous

            Hello All, I have one form name Form1 and from Form1 i have declared as follws ------------------------------- Private frm2 as new Form2 frm2.showdialog(Me) ------------------------- Now frm2 open and get some values in textboxes,in my case i want to retun back this values to previous Form's Datagrid ,(means Form1's Datagrid) for displaying, How can i solve this,anybody can help me will be appreciated:zzz:

            C Offline
            C Offline
            carlos_rocha
            wrote on last edited by
            #5

            whasup! You just need to create properties which will contain the values read from the textbox. After you have those values simply dispose your form2 object.After this you still can access the properties of the object because only the visual were disposed you can retrieve the properties by doing: myForm2Object.property1 myForm2Object.property2 (...) myForm2Object = nothing this way you won't need modules. Never say never

            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