Instantiate a form, then find it later, without showing it initially

Posted by awilson53 on Stack Overflow See other posts from Stack Overflow or by awilson53
Published on 2010-05-04T14:13:30Z Indexed on 2010/05/04 14:28 UTC
Read the original article Hit count: 178

Filed under:
|
|
|

I am having a problem that is strange to me but hopefully is not so strange to someone else. : ) Some background: I am working on a simple IM client that allows the user to broadcast messages to multiple recipients. The goal is to create a chat form for each of the recipients containing the text of the broadcast message, then show that form only if the recipient responds to the broadcast-er. However, when the application receives a response then attempts to locate the form for that particular chat session (using Application.OpenForms) it cannot find it UNLESS I .Show at the time it is created. I would like to avoid having to show this form when it is created because this means that the user will see a flash on the screen. The form doesn't seem to really be created until I show it, but it would seem there has to be a way to do this without showing first. Can anyone assist?

I can provide code snippets if needed, I didn't in this post because this feels more like a conceptual misunderstanding on my part than a bug in the code. Thanks in advance!

© Stack Overflow or respective owner

Related posts about c#

Related posts about forms