Click here to Skip to main content
15,902,844 members
Articles / Desktop Programming / Windows Forms
Alternative
Tip/Trick

Single Instance Form in a MDI application

Rate me:
Please Sign up or sign in to vote.
4.50/5 (2 votes)
20 Sep 2011CPOL 5.6K   1  
Assuming you only want a single instance of a form type, I'd suggest you add a Dictionary(Of Type, Form). ShowOrActiveForm would have a single parameter of Type and would be a subroutine.The Form object could be found based on a ContainsKey. The rest of the ShowOrActiveForm function would be...

Assuming you only want a single instance of a form type, I'd suggest you add a Dictionary(Of Type, Form). ShowOrActiveForm would have a single parameter of Type and would be a subroutine.


The Form object could be found based on a ContainsKey. The rest of the ShowOrActiveForm function would be the same.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --