locked
ShowDialog and focus in a C# windows app RRS feed

  • Question

  • I have a C# windows app with 2 forms- form1 and Login.
    when the app starts, I create a new form1. In the Load eventhandler for form1, I show the Login form using ShowDialog.

    Program.cs -Main
    ...Application.Run( new Form1() );
    ...

    Form1_Load

    ...LogIn lDlg = new LogIn();
    if( lDlg.ShowDialog(this) == DialogResult.OK )
    {
    ...
    }

    When I debug my app, the LogIn form is automatically activated and gets focus in the username field.
    But in release mode, the LogIn form shows up as deactivated and I have to click on it to activate it.
    Why is this happening? How do I solve it?

    Thanks.

    • Edited by SngThk Wednesday, June 11, 2008 12:22 AM c3 to C#
    • Moved by jack 321 Friday, June 13, 2008 7:04 AM Off topic for C# language
    Wednesday, June 11, 2008 12:22 AM

Answers

All replies