Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 211623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:06:43+00:00 2026-05-11T18:06:43+00:00

EDIT 2 Okay, based on the advice on the answers below I eliminated my

  • 0

EDIT 2

Okay, based on the advice on the answers below I eliminated my thread approach and now my program looks like this:
program.cs

 static void Main(){

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

FrmWWCShell FrmWWCShell = null;
var splash = new FrmSplash();
splash.SplashFormInitialized += delegate
                                {
                                    FrmWWCShell = new FrmWWCShell();
                                    splash.Close();
                                };
Application.Run(splash);
Application.Run(FrmWWCShell);

}

And FrmSplash.cs like this:

public partial class FrmSplash : Form
{

    public FrmSplash()
    {
        InitializeComponent();
    }

    protected override void  OnLoad(EventArgs e)
    {
        splashTimer.Interval = 1;
        splashTimer.Tick +=
            delegate { if (SplashFormInitialized != null) SplashFormInitialized(this, EventArgs.Empty); };
        splashTimer.Enabled = true;
    }

    public event EventHandler SplashFormInitialized;
}

The problem is that it doesn’t work at all now. The splash screen pops up for a split second, the marque progress bar never even initializes, and then disappears while I wait the 10 secs for the dll’s and Main Form to show up while staring at nothing….

Color me severely confused now!


ORIGINAL POST–> for reference

I implemented a App Loading splash screen that operates on a seperate thread while all of the dll’s are loading and the form is getting “Painted.” That works as expected. What is strange is that now when the Splash form exits it sends my main Form to the back, if there is anything else open(i.e. Outlook). I start the thread in Program.cs,

static class Program
{
    public static Thread splashThread;

    [STAThread]
    static void Main()
    {
        splashThread = new Thread(doSplash);
        splashThread.Start();

        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new FrmWWCShell());
    }

    private static void doSplash()
    {
        var splashForm = new FrmSplash();
        splashForm.ShowDialog();
    }
}

And then I end it once my FrmSearch_Shown event is fired.

private void FrmSearch_Shown(object sender, EventArgs e)
    {
        Program.splashThread.Abort();
        this.Show();
        this.BringToFront();
    }

I, as you can see, have tried calling a Show() and/or BringToFront() on FrmSearch and it still “jumps” to the back.

What am I missing?
What else can I try?
Am I doing this so horribly ignorant that it is my process that is causing this?
Should I file for early retirement?

Thanks for any insight!


EDIT 1

I tried setting the TopMost Property on my Main Form to TRUE. This keeps my form from hiding but it also keeps the user from looking at any other app. Seems a little narcissistic of me…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:06:44+00:00Added an answer on May 11, 2026 at 6:06 pm

    First of all, it’s very important that UI work is done on the primary application thread. I’m actually kind of surprised that you’re not getting more serious errors already by showing the splash screen on a background thread.

    Here’s a technique I’ve used:

    Use Application.Run on your splash form rather than your “real” form.

    In your splash form, have an initialized event:

    public event EventHandler SplashFormInitialized
    

    Create a timer that fires in one millisecond, and triggers that event.

    Then in your application run method you can load your real form, then close your splash form and do an Application.Run on the real form

    var realForm = null;
    
    var splash = new SplashForm();
    splash.SplashFormInitialized += delegate {
      // As long as you use a system.windows.forms.Timer in the splash form, this
      // handler will be called on the UI thread
      realForm = new FrmWWCShell();
      //do any other init
      splash.Close();
    }
    Application.Run(splash); //will block until the splash form is closed
    
    Application.Run(realForm);
    

    The splash might include:

    overrides OnLoad(...)
    {
       /* Using a timer will let the splash screen load and display itself before
          calling this handler
       */
       timer.Interval = 1;
       timer.Tick += delegate {
         if (SplashFormInitialized != null) SplashFormInitialized(this, EventArgs.Empty);
       };
       timer.Enabled = true; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Okay, I've stripped this down to the bare minimum. The below code is
Second EDIT: Looks like my issue might be where the date is set from
Okay, simple template question. Say I define my template class something like this: template<typename
Okay I edit my question, try to explain it more clearly: I have a
OKay I don't use actionscript and trying to help my friend edit a flash
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
EDIT: See my answer below--> I am wanting to have a view that when
Edit (updated question) I have a simple C program: // it is not important
EDIT : It turned out that this can only be done through an external
Based on this example (which works): var Comment = new Schema(); Comment.add({ title :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.