0
votes

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.

1
Use less words, more code. I can't tell the problem from this. - Henk Holterman
Their is no problem, it just does not work. I'm looking for proper way of doing this. - iKonroi
OK, as long as that's not a problem... - Henk Holterman

1 Answers

0
votes

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....