Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
QuestionRun Multiple Forms Pin
share_holder21-Aug-11 22:45
share_holder21-Aug-11 22:45 
AnswerRe: Run Multiple Forms Pin
Wayne Gaylard21-Aug-11 23:00
professionalWayne Gaylard21-Aug-11 23:00 
AnswerRe: Run Multiple Forms [modified] Pin
Shameel21-Aug-11 23:39
professionalShameel21-Aug-11 23:39 
GeneralRe: Run Multiple Forms Pin
BillWoodruff22-Aug-11 3:34
professionalBillWoodruff22-Aug-11 3:34 
GeneralRe: Run Multiple Forms Pin
Luc Pattyn22-Aug-11 3:49
sitebuilderLuc Pattyn22-Aug-11 3:49 
GeneralRe: Run Multiple Forms Pin
Shameel22-Aug-11 4:04
professionalShameel22-Aug-11 4:04 
GeneralRe: Run Multiple Forms [modified] Pin
BillWoodruff22-Aug-11 20:24
professionalBillWoodruff22-Aug-11 20:24 
GeneralRe: Run Multiple Forms Pin
Luc Pattyn23-Aug-11 1:45
sitebuilderLuc Pattyn23-Aug-11 1:45 
I'm afraid I can't agree once more.
public static void Main() {
    Application.Run(new Form1());
    Application.Run(new Form2());
}


makes perfect sense to me, it will show and run Form2 once you're done with Form1; there may be no need to share state between those Forms, or there may be some mechanism that shares that state, maybe additional data structures in the class that holds such Main() method, maybe in some other global or singleton class, maybe in a database, you name it.

A simple example could be: Form2 is the actual application, Form1 is a complex license dialog which connects to a license server, interacts with the user, asks for a new license key, etc. When the license fails, it calls Application.Exit(), preventing Form2 to even get constructed, hence being safer than a dialog shown by Form2's constructor or Load event.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Run Multiple Forms Pin
Shameel22-Aug-11 4:03
professionalShameel22-Aug-11 4:03 
GeneralRe: Run Multiple Forms Pin
BillWoodruff22-Aug-11 20:35
professionalBillWoodruff22-Aug-11 20:35 
AnswerRe: Run Multiple Forms Pin
share_holder21-Aug-11 23:53
share_holder21-Aug-11 23:53 
GeneralRe: Run Multiple Forms Pin
BillWoodruff22-Aug-11 3:44
professionalBillWoodruff22-Aug-11 3:44 
AnswerRe: Run Multiple Forms Pin
share_holder22-Aug-11 1:14
share_holder22-Aug-11 1:14 
GeneralRe: Run Multiple Forms Pin
Not Active22-Aug-11 2:14
mentorNot Active22-Aug-11 2:14 
GeneralRe: Run Multiple Forms Pin
share_holder22-Aug-11 21:16
share_holder22-Aug-11 21:16 
AnswerRe: Run Multiple Forms [modified] Pin
BillWoodruff22-Aug-11 3:17
professionalBillWoodruff22-Aug-11 3:17 
GeneralRe: Run Multiple Forms Pin
share_holder22-Aug-11 21:15
share_holder22-Aug-11 21:15 
GeneralRe: Run Multiple Forms Pin
BillWoodruff22-Aug-11 21:28
professionalBillWoodruff22-Aug-11 21:28 
GeneralRe: Run Multiple Forms Pin
share_holder22-Aug-11 21:33
share_holder22-Aug-11 21:33 
GeneralRe: Run Multiple Forms Pin
share_holder23-Aug-11 1:39
share_holder23-Aug-11 1:39 
Questiontwo use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BillWoodruff21-Aug-11 22:28
professionalBillWoodruff21-Aug-11 22:28 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BobJanova21-Aug-11 22:49
BobJanova21-Aug-11 22:49 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 2:07
mveDave Kreskowiak22-Aug-11 2:07 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BillWoodruff22-Aug-11 3:28
professionalBillWoodruff22-Aug-11 3:28 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 4:10
mveDave Kreskowiak22-Aug-11 4:10 

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.