Pass incoming data from Child to parent Form
-
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
-
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
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
-
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
Thanks Pete.
-
Thanks Pete.
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) -
Thanks Pete.
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