|
-
Dec 9th, 2009, 10:40 PM
#1
Thread Starter
Addicted Member
Help in single form instantiation
hello There,
I just like to know if how can i do single form instantiation upon loading my Form..upon loading my MainForm it automatically detect if that MainForm is still exist..ive try putting my code in the contructor of my MainForm..i check through the process in the task manager if that MainForm is still exist..but i think this is not the good idea bcoz..the MainForm takes several seconds to appear..and i think this is bcoz i loop through the process..
hop u can help me.
glen
-
Dec 9th, 2009, 11:01 PM
#2
Re: Help in single form instantiation
If you can upgrade to VS 2005 or later then that functionality is provided with the check of a box in the project properties.
In VS.NET 2003 it's a bit tricky. The simplest way is to call Process.GetProcessesByName to see if your process is already running and only call Application.Run if it's not, although that is not a 100% ideal solution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|