Microsoft
Software
Hardware
Network
Question : Help Displaying Message on Correct Child Form in MDI Parent
I am trying to get a VB .Net application working that has the following:
MDI Parent Form
4 Child Windows Forms
One socket that listens for incoming messages on a separate thread
Parsing the incoming socket message will tell me on which of the 4 child windows to display the message
Assuming the incoming message looks something like:
{ScreenName}^{Message}
Screen1^This is a test message
When the message is received, how would I then get the message back to the correct form
I plan on using a delegate to pass the message back to the GUI thread. Something like:
ChildForm.DisplayMessage(m
essageToDi
splay)
Each of the four child forms has a handler for the delegate. Something like:
Private Delegate Sub DisplayMessageHandler(ByVa
l messageToDisplay As String)
My question is how to get the incoming message to the correct form. For example, if the message is "Screen1^This is a test message", how can I get it to display on child form 1, and not on child forms 2, 3, and 4?
Answer : Help Displaying Message on Correct Child Form in MDI Parent
That is correct. Or you could use
For each frm as Form1 in mainForm.ChildForms
Where you specify the correct type immediatly, so you can avoid the DirectCast.
Random Solutions
Table design to enforce interesting constraint logic
macro question which columns is the data changing
Outlook Anywhere - Exchange 2007 (SBS 2008) and Outlook 2003 / 2007
Convienent way to plot addresses on a map
Blackberry Enterprise Server Errors
MS Access tab control background colour
Looking for a bootable CD that will allow advanced Windows recover and repair options to be run, such as using System Restore to restore the system to a prior date
Access - Calling a Sub form after a "click"
Replacing CreateDIBSection with CBitmap
IIS: How to define multiple web sites, each with their own domain and SSL?