29 Replies - 2208 Views - Last Post: 09 February 2011 - 10:50 AM
#1
How does Application.Run work?
Posted 08 February 2011 - 11:15 AM
Regards
Replies To: How does Application.Run work?
#2
Re: How does Application.Run work?
Posted 08 February 2011 - 11:22 AM
#3
Re: How does Application.Run work?
Posted 08 February 2011 - 11:48 AM
For example, I want to use, two Application.Run in my application, when one form is closed, one other form is opened and I use an Application.Run to do that, but in the second one doesn't have the functionality of the first, that's why I need to really know the inside functioanlity.
#4
Re: How does Application.Run work?
Posted 08 February 2011 - 12:05 PM
http://msdn.microsof...(v=VS.100).aspx
Link is in spanish so you can understand it better.
Basically, when the Form1 fires the Closing event, open the other Form.
This post has been edited by Sergio Tapia: 08 February 2011 - 12:06 PM
#5
Re: How does Application.Run work?
Posted 08 February 2011 - 12:06 PM
#6
Re: How does Application.Run work?
Posted 08 February 2011 - 12:09 PM
The first form, is closed and it triggers the other one to open, but the other one just open and close at the instant, because the second Application.Run seems to don't stop.
I hope I explain well what my problem is.
#7
Re: How does Application.Run work?
Posted 08 February 2011 - 12:22 PM
#8
Re: How does Application.Run work?
Posted 08 February 2011 - 01:04 PM
tigre_jose2, on 08 February 2011 - 03:09 PM, said:
The first form, is closed and it triggers the other one to open, but the other one just open and close at the instant, because the second Application.Run seems to don't stop.
I hope I explain well what my problem is.
Thats because you can't close the opening form of an application. Closing the first form will close the application.
We normally handle this by hiding the first form when the second form opens.
Form2 f2 = new Form2(); f2.Open(); this.Hide();
#9
Re: How does Application.Run work?
Posted 08 February 2011 - 01:33 PM
#10
Re: How does Application.Run work?
Posted 08 February 2011 - 01:36 PM
#11
Re: How does Application.Run work?
Posted 08 February 2011 - 01:39 PM
tigre_jose2, on 08 February 2011 - 02:36 PM, said:
Process isn't actually a namespace, it's a class inside the System.Diagnostics namespace. It's used for exactly what it sounds like: processes. Starting and manipulating processes.
Again, a quick trip to the MSDN would have helped there.
I don't think that's what you're trying to do. I think you're trying to open one form after the other closes. I think you should look into what the others have already mentioned.
#12
Re: How does Application.Run work?
Posted 08 February 2011 - 01:42 PM
#13
Re: How does Application.Run work?
Posted 08 February 2011 - 01:42 PM
this.Close();
Form form = new Form();
form.Show();
Because all the logic isn't in the form code, is in another class that's handling all that, that's why I need the two Application.Run.
#14
Re: How does Application.Run work?
Posted 08 February 2011 - 01:58 PM
Look, pretend that your Program.cs file doesn't exist. This logic doesn't happen there. The entire Application logic exists in your main Form class.
So in that form class, you can do exactly what eclipsed mentioned further up the thread.
This post has been edited by insertAlias: 08 February 2011 - 02:00 PM
#15
Re: How does Application.Run work?
Posted 08 February 2011 - 02:00 PM
|
|

New Topic/Question
Reply




MultiQuote





|