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

Related Questions

I have the code below on form so that the user submits the form
I have below html code in my aspx. <input type=hidden id=medicalLink value='<a href=/forms/contactus.aspx >Contact
I have a real basic form (code below) with a bunch of back-panel PhP.
I have below html code in one of the opensource project. <form action=/wiki/bin/view/Main/Search> <div
I have the following form code: # forms.py class SomeForm(forms.Form): hello = forms.CharField(max_length=40) world
I have the following line of code for a Windows forms application: return Encoding.ASCII.GetBytes(chars.ToArray());
The below code makes application freeze when changing focus from Edit1 to Edit2 after
I have the code below at the moment. When the form loads, a ball
EDITED with solution (below...) I have a Splash screen that is packaged into it's
I have an application having 2 Forms, each Form and Application have individual Icon.

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.