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 943201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:23:53+00:00 2026-05-15T22:23:53+00:00

I have 2 forms. Form1 (with code below) and Splash (just default form for

  • 0

I have 2 forms. Form1 (with code below) and Splash (just default form for test).

My problem is that after application run the Splash doesn’t hide. Main form is loaded but Splash is still not closed.

The Form1 code:

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Microsoft.VisualBasic.ApplicationServices;

namespace WindowsFormsApplication2
{
    class Program : WindowsFormsApplicationBase 
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());

            // Show Form in Single-instance mode
            var prg = new Program();
            prg.EnableVisualStyles = true;
            prg.IsSingleInstance = true;
            prg.MinimumSplashScreenDisplayTime = 1000;
            prg.SplashScreen = new Splash();
            prg.MainForm = new Form1();
            prg.Run(args);
        }
    }
}

You must add reference to Microsoft.VisualBasic to work of this.

Splash form code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Splash : Form
    {
        public Splash()
        {
            InitializeComponent();
        }
    }
}

Thank you in advance for your help.

  • 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-15T22:23:53+00:00Added an answer on May 15, 2026 at 10:23 pm

    Ah you’re using the Visual Basic Appplication Framework to run the splash screen?
    Try this.
    This is from a quick Forms application – note that I have left all names and namespace as default, so you may need to change this for your code. The project has two forms only. Form2 is the splash screen. I embedded a background image on it in order to ensure that it popped up okay and that I could differentiate it from Form1.

    I added a reference to .NET Microsoft.VisualBasic into my project.

    This is from the program.cs file

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;
    using Microsoft.VisualBasic.ApplicationServices;
    
    namespace WindowsFormsApplication1
    {
        static class Program
        {
            [STAThread]
            static void Main(string[] args)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                new MyApp().Run(args);
            }
        }
        public class MyApp : WindowsFormsApplicationBase
        {
            protected override void OnCreateSplashScreen()
            {
                this.SplashScreen = new Form2();
            }
            protected override void OnCreateMainForm()
            {
                // Do your initialization here
                //...
                System.Threading.Thread.Sleep(5000);  // Test
                // Then create the main form, the splash screen will automatically close
                this.MainForm = new Form1();
            }
        }
    }
    

    I know that is different to wht you’re using but it seems to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 501k
  • Answers 501k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can do it by invoking the constructor for the… May 16, 2026 at 2:20 pm
  • Editorial Team
    Editorial Team added an answer Seems it's just an invalid body of response, that does… May 16, 2026 at 2:20 pm
  • Editorial Team
    Editorial Team added an answer This will return Recipes that contain sesame oil (two words… May 16, 2026 at 2:20 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a bit of code below that creates a button on a html
I have 2 forms. Form1 with one panel and 2 buttons (pnl1, btnShowTree and
I have a form that is displayed, not by ShowDialog, but by setting its
Below i have pasted my piece of javascript code here 1) function showCustomerName(dropdown) {
Hi I have a form with a text area for comments. The problem is
I have an input box that that is part of a form . depending
I'm a EE newbie. I have the code below. the poll weblog displays at
I have the array example below that I am using to dynamically create an
I'm using Peter Below's PBThreadedSplashForm to display during application startup. It gets updated as
I have a C# WinForms application. This exception is thrown within the static void

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.