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. Sending information to and from different forms

Sending information to and from different forms

Scheduled Pinned Locked Moved Visual Basic
helpquestion
3 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.
  • E Offline
    E Offline
    Emile Jacobs
    wrote on last edited by
    #1

    I am currently developing a system as a project for an university subject but is struggeling with something that is affecting everything in the system. I have an open form, where you enter information on a school / university. On the form you click on a button to register a contact person for that school / university. This button opens another form (the contact person form). After completing all the necessary contact's information and close the form, the contact person's name, surname and telephone must be showed in the previous form. How on earth do you send the information from the contact form to the previous form (that is still open)????? Can anybody help me?!? This is very important, for my whole project depends on this!!! :((

    D 1 Reply Last reply
    0
    • E Emile Jacobs

      I am currently developing a system as a project for an university subject but is struggeling with something that is affecting everything in the system. I have an open form, where you enter information on a school / university. On the form you click on a button to register a contact person for that school / university. This button opens another form (the contact person form). After completing all the necessary contact's information and close the form, the contact person's name, surname and telephone must be showed in the previous form. How on earth do you send the information from the contact form to the previous form (that is still open)????? Can anybody help me?!? This is very important, for my whole project depends on this!!! :((

      D Offline
      D Offline
      dynamic
      wrote on last edited by
      #2

      try this : In Form1:


      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim frm2 As New Form2()
      Me.AddOwnedForm(frm2) '/// add it as an owned form.
      frm2.Show() '/// show it.
      End Sub


      In Form2:


      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim frm1 As Form1 = Me.Owner
      frm1.TextBox1.AppendText("some text from Form2 , to Form1!")
      End Sub


      hope it helps :) Vb:


      Public Function TwinsOnWay(ByVal twins As String) As String
      Select Case twins
      Case "Gender"
      Return "Two Girls"
      End Select
      End Function


      E 1 Reply Last reply
      0
      • D dynamic

        try this : In Form1:


        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim frm2 As New Form2()
        Me.AddOwnedForm(frm2) '/// add it as an owned form.
        frm2.Show() '/// show it.
        End Sub


        In Form2:


        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim frm1 As Form1 = Me.Owner
        frm1.TextBox1.AppendText("some text from Form2 , to Form1!")
        End Sub


        hope it helps :) Vb:


        Public Function TwinsOnWay(ByVal twins As String) As String
        Select Case twins
        Case "Gender"
        Return "Two Girls"
        End Select
        End Function


        E Offline
        E Offline
        Emile Jacobs
        wrote on last edited by
        #3

        Thanx A LOT!!! I am going to try it! I knew the answer is easy, but you know how it goes - one always looks for the most difficult solution... Good luck with the twins... If I can't get it to work, you will hear from me again...:cool:

        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