none
SmartClient App opens behind IE RRS feed

  • Question

  • Hi,
    I've added a Splash Screen to my application but now my app open behind IE when I run it. The Splash Screen displays correctly infront of IE. If I remove the splash then the app opens correcly infront of IE.

    How do I force the app to always open infront of all other apps? I've tried BringToFront() on my MainForm but that did not help.

    Thanks,
    JB

    Here is my code from Program.cs:

    [STAThread]

    static void Main()

    {

    // Show the SplashScreen in it's own thread

    Thread th = new Thread(new ThreadStart(DoSplash));

    th.IsBackground = true;

    th.Start();

    MainForm mainForm = new MainForm();

    if (mainForm.login())

    {

    // Close the SplashScreen by terminating the thread

    if (th.IsAlive) th.Abort();

    Application.Run(mainForm);

    }

    else

    {

    // Close the SplashScreen by terminating the thread

    if (th.IsAlive) th.Abort();

    }

    }

    static void DoSplash()

    {

    SplashScreen splashScreen = new SplashScreen();

    splashScreen.lcLoading.Text = string.Format("Loading {0}. Please Wait...", ConfigurationManager.AppSettings["ApplicationName"]);

    splashScreen.ShowDialog();

    }

    Friday, March 6, 2009 12:44 PM

All replies

  • I think you can give WindowsFormsApplicationBase.ShowSplashScreen Method a try. If it does not work then abandon your splash screen.
    MSMVP VC++
    Monday, March 9, 2009 5:05 AM
    Moderator
  • Thamks, but isn't WindowsFormsApplicationBase.ShowSplashScreen a VB thing (in the Microsoft.VisualBasic.ApplicationServices namespace)?
    Monday, March 9, 2009 1:55 PM
  • It is a managed code library designed for vb but you can use it in any managed language.
    MSMVP VC++
    Monday, March 9, 2009 2:51 PM
    Moderator