Click here to Skip to main content
15,916,378 members
Home / Discussions / C#
   

C#

 
General[Message Deleted] Pin
matt cole28-Aug-05 18:25
matt cole28-Aug-05 18:25 
GeneralRe: Convert.ToBase64 question Pin
matt cole28-Aug-05 18:26
matt cole28-Aug-05 18:26 
GeneralRe: Convert.ToBase64 question Pin
Andy Brummer28-Aug-05 19:13
sitebuilderAndy Brummer28-Aug-05 19:13 
General[Message Deleted] Pin
matt cole28-Aug-05 19:18
matt cole28-Aug-05 19:18 
GeneralRe: Convert.ToBase64 question Pin
matt cole28-Aug-05 19:19
matt cole28-Aug-05 19:19 
QuestionAplication.run Pin
xilefxilef28-Aug-05 16:22
xilefxilef28-Aug-05 16:22 
GeneralRe: Aplication.run Pin
Andy Brummer28-Aug-05 16:59
sitebuilderAndy Brummer28-Aug-05 16:59 
AnswerRe: Aplication.run Pin
Luis Alonso Ramos28-Aug-05 17:04
Luis Alonso Ramos28-Aug-05 17:04 
What I would do is run the main form normally, and then handle the Activated event for the form, and if it's the first time, display the dialog.
bool firstTime = true;
 
protected override void OnActivated(EventArgs e)
{
    if(firstTime)
    {
        firstTime = false;
        LoginForm form = new LoginForm();
        form.ShowDialog(this);
    }
}
That should work, displaying the main form and the login form on top of it.

But, my real solution would be to implement a main form with everything disabled if no user is logged in. This way a user can log in, then log out, and then another user log in without terminating your app, and only the corresponding menu items would be enabled.

And then, in the Activated event for the first time, simulate that the Log In menu item was selected. This way, if the user can't log in (invalid user or password), the application does not have to end.

-- LuisR



Luis Alonso Ramos
Intelectix - Chihuahua, Mexico

Not much here: My CP Blog!


The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
GeneralRe: Aplication.run Pin
xilefxilef28-Aug-05 18:45
xilefxilef28-Aug-05 18:45 
GeneralRe: Aplication.run Pin
Andy Brummer28-Aug-05 19:26
sitebuilderAndy Brummer28-Aug-05 19:26 
GeneralRe: Aplication.run Pin
Luis Alonso Ramos28-Aug-05 20:07
Luis Alonso Ramos28-Aug-05 20:07 
GeneralRe: Aplication.run Pin
Robert Rohde28-Aug-05 20:17
Robert Rohde28-Aug-05 20:17 
QuestionHow to avoid flickering problem when drawing?` Pin
radic.feng28-Aug-05 15:25
radic.feng28-Aug-05 15:25 
AnswerRe: How to avoid flickering problem when drawing?` Pin
Christian Graus28-Aug-05 15:35
protectorChristian Graus28-Aug-05 15:35 
GeneralRe: How to avoid flickering problem when drawing?` Pin
radic.feng28-Aug-05 17:19
radic.feng28-Aug-05 17:19 
QuestionHelp! help! Newbie... Pin
boggs28-Aug-05 15:11
boggs28-Aug-05 15:11 
AnswerRe: Help! help! Newbie... Pin
Christian Graus28-Aug-05 15:36
protectorChristian Graus28-Aug-05 15:36 
GeneralRe: Help! help! Newbie... Pin
boggs28-Aug-05 15:43
boggs28-Aug-05 15:43 
QuestionHow do I get the amount of memory an object Pin
Member 9628-Aug-05 11:37
Member 9628-Aug-05 11:37 
AnswerRe: How do I get the amount of memory an object Pin
Guffa28-Aug-05 13:27
Guffa28-Aug-05 13:27 
GeneralRe: How do I get the amount of memory an object Pin
Andy Brummer28-Aug-05 17:07
sitebuilderAndy Brummer28-Aug-05 17:07 
AnswerMarshal.SizeOf won't work Pin
Daniel Turini28-Aug-05 22:40
Daniel Turini28-Aug-05 22:40 
QuestionC# Convert Cobol Copybook data into Excel Spreadsheet Pin
dsrao28-Aug-05 11:22
dsrao28-Aug-05 11:22 
QuestionUSB Port Pin
Shahin7728-Aug-05 11:05
Shahin7728-Aug-05 11:05 
AnswerRe: USB Port Pin
eggie528-Aug-05 12:34
eggie528-Aug-05 12:34 

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.