B2Ben
Well-known member
- Joined
- Aug 17, 2006
- Messages
- 52
- Programming Experience
- Beginner
Hey all -
I've been developing a project with one main parent form that watches the COM port for commands. When a command comes in, I'd like to pass along that data to one or many child forms. I have my parent and child forms built, but I need to make them interact.
Here's the basic idea of what I'm trying to accomplish...
ParentForm has an array of ChildForms
Each ChildForm has a public variable called "Address"
So...
- A command comes in off the COM port
- ParentForm parses it, and extracts the "Address"
- ParentForm loops through its array of child forms
For each childform in the array...
-- If the child's Address variable is the one we want, activate Child's "ProcessCommand" function using the command that just came in
Next
If a Child form wants to send back a command over the COM port, it should be able to access a function in the ParentForm to send out that command on the COM line.
Basically, the parent form handles all the COM port communications. The child forms will process a command if it is meant for them, and the child forms tell the parent form when to send a command back out on the COM port.
...I hope that all made sense. I'm learning more and more with each VB.NET project I tackle, but I still have trouble getting my forms to talk to each other... and especially using multiple instances of child forms in this case. Any help would be appreciated.
I've been developing a project with one main parent form that watches the COM port for commands. When a command comes in, I'd like to pass along that data to one or many child forms. I have my parent and child forms built, but I need to make them interact.
Here's the basic idea of what I'm trying to accomplish...
ParentForm has an array of ChildForms
Each ChildForm has a public variable called "Address"
So...
- A command comes in off the COM port
- ParentForm parses it, and extracts the "Address"
- ParentForm loops through its array of child forms
For each childform in the array...
-- If the child's Address variable is the one we want, activate Child's "ProcessCommand" function using the command that just came in
Next
If a Child form wants to send back a command over the COM port, it should be able to access a function in the ParentForm to send out that command on the COM line.
Basically, the parent form handles all the COM port communications. The child forms will process a command if it is meant for them, and the child forms tell the parent form when to send a command back out on the COM port.
...I hope that all made sense. I'm learning more and more with each VB.NET project I tackle, but I still have trouble getting my forms to talk to each other... and especially using multiple instances of child forms in this case. Any help would be appreciated.