Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
QuestionApplication terminates when window gets closed Pin
MarioMARTIN21-Aug-07 3:59
MarioMARTIN21-Aug-07 3:59 
AnswerRe: Application terminates when window gets closed Pin
MarioMARTIN21-Aug-07 5:07
MarioMARTIN21-Aug-07 5:07 
GeneralRe: Application terminates when window gets closed Pin
Not Active21-Aug-07 5:44
mentorNot Active21-Aug-07 5:44 
GeneralRe: Application terminates when window gets closed Pin
MarioMARTIN21-Aug-07 5:47
MarioMARTIN21-Aug-07 5:47 
GeneralRe: Application terminates when window gets closed Pin
Not Active21-Aug-07 11:03
mentorNot Active21-Aug-07 11:03 
GeneralRe: Application terminates when window gets closed Pin
MarioMARTIN21-Aug-07 19:30
MarioMARTIN21-Aug-07 19:30 
GeneralRe: Application terminates when window gets closed Pin
Not Active22-Aug-07 0:21
mentorNot Active22-Aug-07 0:21 
AnswerRe: Application terminates when window gets closed Pin
Luc Pattyn21-Aug-07 5:52
sitebuilderLuc Pattyn21-Aug-07 5:52 
Hi,

a normal window app has an Application.Run(new Form1()); in its static main method.
The Run method will show the Form1 instance (and run a message loop to do that),
and it will return when the form gets closed or Application.Exit() gets called.

as an alternative you can call Application.Run(); without arguments;
that one will start a message pump and return when Application.Exit() gets called.

Hope this helps.


Luc Pattyn [Forum Guidelines] [My Articles]


this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google


GeneralRe: Application terminates when window gets closed Pin
MarioMARTIN21-Aug-07 6:00
MarioMARTIN21-Aug-07 6:00 
GeneralRe: Application terminates when window gets closed Pin
Luc Pattyn21-Aug-07 6:23
sitebuilderLuc Pattyn21-Aug-07 6:23 
AnswerRe: Application terminates when window gets closed Pin
MarioMARTIN21-Aug-07 6:19
MarioMARTIN21-Aug-07 6:19 
GeneralRe: Application terminates when window gets closed Pin
Martin#21-Aug-07 8:17
Martin#21-Aug-07 8:17 
GeneralRe: Application terminates when window gets closed Pin
MarioMARTIN21-Aug-07 19:21
MarioMARTIN21-Aug-07 19:21 
GeneralRe: Application terminates when window gets closed Pin
Martin#21-Aug-07 21:17
Martin#21-Aug-07 21:17 
AnswerRe: Application terminates when window gets closed Pin
MarioMARTIN21-Aug-07 19:35
MarioMARTIN21-Aug-07 19:35 
Questionc# Pin
lankaudaranga21-Aug-07 2:40
lankaudaranga21-Aug-07 2:40 
AnswerRe: c# Pin
Justin Perez21-Aug-07 2:43
Justin Perez21-Aug-07 2:43 
GeneralRe: c# Pin
leckey21-Aug-07 3:54
leckey21-Aug-07 3:54 
GeneralRe: c# Pin
Justin Perez21-Aug-07 3:57
Justin Perez21-Aug-07 3:57 
GeneralRe: c# Pin
Martin#21-Aug-07 4:02
Martin#21-Aug-07 4:02 
GeneralRe: c# Pin
J4amieC21-Aug-07 4:38
J4amieC21-Aug-07 4:38 
GeneralIt leads to nothing but bad spirit! Pin
Martin#21-Aug-07 21:27
Martin#21-Aug-07 21:27 
GeneralRe: c# Pin
Talal Sultan21-Aug-07 5:34
Talal Sultan21-Aug-07 5:34 
GeneralRe: c# Pin
leckey21-Aug-07 5:44
leckey21-Aug-07 5:44 
AnswerRe: c# Pin
Talal Sultan21-Aug-07 2:49
Talal Sultan21-Aug-07 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.