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. Windows Forms
  4. Pass incoming data from Child to parent Form

Pass incoming data from Child to parent Form

Scheduled Pinned Locked Moved Windows Forms
jsontutorialquestion
5 Posts 3 Posters 2 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.
  • K Offline
    K Offline
    KenKen Wong
    wrote on last edited by
    #1

    Hi, I wrote 1 form and 1 component for my application - parent form with listBox (which can display the incoming string) - child component whic is a socket class to receive and send data. In my program, i create a socket with child component. Then it will receive the incoming data with asynchronous method. When a string is received, i would like to pass it to the parent form, which has a function for string manipulation and display the string finally. However, I don't know how to do the "child data pass to parent" method. Do you have any idea for me? Does Windows From have any API for that? Thanks. Ken

    P 1 Reply Last reply
    0
    • K KenKen Wong

      Hi, I wrote 1 form and 1 component for my application - parent form with listBox (which can display the incoming string) - child component whic is a socket class to receive and send data. In my program, i create a socket with child component. Then it will receive the incoming data with asynchronous method. When a string is received, i would like to pass it to the parent form, which has a function for string manipulation and display the string finally. However, I don't know how to do the "child data pass to parent" method. Do you have any idea for me? Does Windows From have any API for that? Thanks. Ken

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      KenKen Wong wrote:

      Does Windows From have any API for that?

      How about raising an event on the child form that the parent form listens to and acts on? All the child form needs to do then is check that there's something listening to the eventhandler and raise the event.

      I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      K 1 Reply Last reply
      0
      • P Pete OHanlon

        KenKen Wong wrote:

        Does Windows From have any API for that?

        How about raising an event on the child form that the parent form listens to and acts on? All the child form needs to do then is check that there's something listening to the eventhandler and raise the event.

        I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        K Offline
        K Offline
        KenKen Wong
        wrote on last edited by
        #3

        Thanks Pete.

        D P 2 Replies Last reply
        0
        • K KenKen Wong

          Thanks Pete.

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          To follow on from Pete's reply, this Tip[^], this Tip[^] and this Article[^] may help if you need them.

          Dave
          Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum. Astonish us. Be exceptional. (Pete O'Hanlon)
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

          1 Reply Last reply
          0
          • K KenKen Wong

            Thanks Pete.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            You're welcome. Glad to be of help. :-D

            I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            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