0

I've been stuck here for a few hours looking up code for hours and making batches of my own. One of the code ex I got from here gave me a instant svHost error.

Now my splash screen is my HWID / Serial check, if valid it opens the main form if not it closes the app completely.. But the issue is I've tried some way's with splash.show(); on the main form but it just freezes and goes all stupid for a few minutes, another thing most of the methods use timers I just need it so when HWID check is valid I can start the main form, I've tried application.Run(new mainForm()); if the HWID was correct then changed the program.cs file around but still no luck, I really need the help. It would be wonderful, thank's.

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
iKonroi
  • 119
  • 2
  • 2
  • 7

1 Answers1

0

I've used splash screen animation while I'm connecting to socket. I've used backgroundworker for it.

Here's my code:

Main Form

LoadingScreen frmLoadingScreen = new LoadingScreen();
.....
bkwNetworkConnector.RunWorkerAsync();

frmLoadingScreen.ShowDialog();

 /***********************************************************************************************************************/
        private void bkwNetworkConnector_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                hostSocket = new TcpClient();
                hostSocket.Connect(strIp, intPort);
            }
            catch (Exception exp)
            {

            }
        }

        private void bkwNetworkConnector_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            frmLoadingScreen.Close();

        }

LoadingScreen Form:

with imagebox control. Load GIF image in it.

private void LoadingScreen_Load(object sender, EventArgs e)
        {
            pbAnimationBox.Image = Properties.Resources.LoadingAnimation; // win 8 animation
        }

I'm using LoadingScreen Form as splash screen.

Hope this will hep you....

Never Quit
  • 2,072
  • 1
  • 21
  • 44