Click here to Skip to main content
15,902,276 members
Home / Discussions / C#
   

C#

 
GeneralRe: Control Panel applets Pin
dsovino2-Jan-07 12:39
dsovino2-Jan-07 12:39 
Questionwhant to compile pascal document for c# Pin
conemajstor2-Jan-07 11:33
conemajstor2-Jan-07 11:33 
AnswerRe: whant to compile pascal document for c# Pin
Christian Graus2-Jan-07 16:00
protectorChristian Graus2-Jan-07 16:00 
GeneralRe: whant to compile pascal document for c# Pin
Uwe Keim2-Jan-07 20:35
sitebuilderUwe Keim2-Jan-07 20:35 
QuestionHow to assign a new Main Form!?? Pin
ferdna2-Jan-07 11:08
ferdna2-Jan-07 11:08 
AnswerRe: How to assign a new Main Form!?? Pin
Colin Angus Mackay2-Jan-07 11:22
Colin Angus Mackay2-Jan-07 11:22 
GeneralRe: How to assign a new Main Form!?? Pin
ferdna2-Jan-07 11:46
ferdna2-Jan-07 11:46 
GeneralRe: How to assign a new Main Form!?? Pin
Colin Angus Mackay2-Jan-07 12:01
Colin Angus Mackay2-Jan-07 12:01 
ferdna wrote:
ok... so, what if i don't want Fom1 anymore!??
lets say that i want to dispose Form1 and make Form2 my main form...

if i close Form1 and Form2 is not the main form then the application will exit...

all, i want to do... is a password dialog...
if password dialog = correct login details then
destroy form1 and load form2 as main form...


Well, I would put the login form as a dialog that is opened when the main form is loaded. But I guess you could also do it this way:
static void Main()
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
 
    LoginForm loginForm = new LoginForm();
    Application.Run(loginForm);
    if (/*some condition that the log in was successful*/)
    {
        MainForm mainForm = new MainForm();
        Application.Run(mainForm);
    }
}



Upcoming Scottish Developers events:
* Glasgow: Tell us what you want to see in 2007


My: Website | Blog | Photos

GeneralRe: How to assign a new Main Form!?? Pin
ferdna2-Jan-07 12:10
ferdna2-Jan-07 12:10 
GeneralRe: How to assign a new Main Form!?? Pin
Colin Angus Mackay2-Jan-07 12:14
Colin Angus Mackay2-Jan-07 12:14 
GeneralRe: How to assign a new Main Form!?? Pin
ferdna2-Jan-07 12:24
ferdna2-Jan-07 12:24 
GeneralRe: How to assign a new Main Form!?? Pin
JoeRip2-Jan-07 13:53
JoeRip2-Jan-07 13:53 
GeneralRe: How to assign a new Main Form!?? Pin
ferdna15-Jan-07 10:45
ferdna15-Jan-07 10:45 
AnswerRe: How to assign a new Main Form!?? Pin
ferdna15-Jan-07 10:46
ferdna15-Jan-07 10:46 
QuestionHow to check that the registry key exists Pin
CodeItWell2-Jan-07 11:06
CodeItWell2-Jan-07 11:06 
AnswerRe: How to check that the registry key exists Pin
Stefan Troschuetz2-Jan-07 11:26
Stefan Troschuetz2-Jan-07 11:26 
QuestionWorkFlow Pin
shabonaa2-Jan-07 10:57
shabonaa2-Jan-07 10:57 
AnswerRe: WorkFlow Pin
Judah Gabriel Himango2-Jan-07 11:48
sponsorJudah Gabriel Himango2-Jan-07 11:48 
AnswerMy Experiences while porting a larger Application from C++ to C# Pin
Uwe Keim2-Jan-07 10:06
sitebuilderUwe Keim2-Jan-07 10:06 
QuestionHow to retain data in sql server Pin
ronaldanthony2-Jan-07 8:18
ronaldanthony2-Jan-07 8:18 
AnswerRe: How to retain data in sql server Pin
Pete O'Hanlon2-Jan-07 9:56
mvePete O'Hanlon2-Jan-07 9:56 
GeneralRe: How to retain data in sql server Pin
ronaldanthony2-Jan-07 20:30
ronaldanthony2-Jan-07 20:30 
Questiongeneric assembly for design patterns? Pin
rahulmballal2-Jan-07 8:04
rahulmballal2-Jan-07 8:04 
AnswerRe: generic assembly for design patterns? Pin
Uwe Keim2-Jan-07 9:08
sitebuilderUwe Keim2-Jan-07 9:08 
GeneralRe: generic assembly for design patterns? Pin
rahulmballal2-Jan-07 10:37
rahulmballal2-Jan-07 10:37 

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.