+ Reply to Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Splash Screen in C#

  1. #11
    Jordan Guest

    Re: Splash Screen in C#

    Quote Originally Posted by Xav View Post
    That is false. Working code is the third best code.

    The second best code is code that is fast for the coder.
    The best code is code that is fast for the user.

    In other words, efficient, optimised code. Therefore Kierens' code is only third best code.
    So you are saying:

    1) Fast code that doesn't do anything is better than...
    2) Code that does not work at all is better than....
    3) Code that works?

    I think you have that backwards because you must first have working code before you can optimize it and make it more efficient.

  2. CODECALL Circuit advertisement

     
  3. #12
    el_rolas is offline Newbie
    Join Date
    Jun 2009
    Posts
    1
    Rep Power
    0

    Re: Splash Screen in C#

    thank you

    I was having troubles with the end of the application

    good tutorial

    and for timer1 code just double click on the timer

  4. #13
    Kierien's Avatar
    Kierien is offline Learning Programmer
    Join Date
    Jan 2009
    Posts
    32
    Rep Power
    13

    Re: Splash Screen in C#

    Quote Originally Posted by el_rolas View Post
    thank you

    I was having troubles with the end of the application

    good tutorial

    and for timer1 code just double click on the timer
    No probs

  5. #14
    soumyo is offline Newbie
    Join Date
    May 2010
    Posts
    1
    Rep Power
    0

    Re: Splash Screen in C#

    Awesome dude.....thanks for this...just as I wanted for my project

  6. #15
    MrrQ is offline Newbie
    Join Date
    Jul 2010
    Posts
    5
    Rep Power
    0

    Re: Splash Screen in C#

    That is a great tutorial. I've started 2 implemant it in my skul assgnments. Big ups!
    I was wondering if u added a progressBar to the splash, will it nid u to delay the timer.

  7. #16
    TNDave's Avatar
    TNDave is offline Newbie
    Join Date
    Dec 2010
    Location
    TN
    Posts
    1
    Rep Power
    0

    Re: Splash Screen in C#

    Just found this. Major help for a newbie to C# . +rep

  8. #17
    sam_coder's Avatar
    sam_coder is offline Programming Expert
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    372
    Rep Power
    7

    Re: Splash Screen in C#

    Quote Originally Posted by Kierien View Post

    Go back to Form1 now, and click the "Events" button (Looks like a lightning icon), and scroll down to "FormClosed", and double click it, it should bring you to the code editor. Now add this code

    Code:
    Application.Exit();
    The reason behind this is because when Splash closes, its actually still running in the background, but just not visible, as because it is the startup form, which C# thinks is the main form, but by adding this code whenever your Form1 closes the whole application closes.

    Hey! Nice Article!

    I just though I could shed some light on this specific section of the article. The reason you need to add Application.Exit() is because When you use
    Application.Run(splash), this is because this begins running the standard application message loop on the current thread and adds an event handler to Closed for the splash screen to Call Exit Thread.
    If it were Form1 that were called with Application.Start, it should terminate the application when that main form is closed.

    One possible work wound would be something to the effect of....

    Code:
    main() {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                (new Splash()).ShowDialog();
                Application.Run(new Form1());
    }
    And then of course changing the timer code to just :

    Code:
    this.Close();
    Anyways, just thought I'd share. Again, nice article!
    Last edited by sam_coder; 12-09-2010 at 10:28 AM. Reason: messed up my closing CODE tag...

  9. #18
    Sp32 is offline Newbie
    Join Date
    Aug 2007
    Posts
    26
    Rep Power
    0

    Re: Splash Screen in C#

    When I add the code in the timer1 it comes up as:

    Code:
    
    Form1 MainForm = new Form1;
    MainForm.Show;
    timer1.Enabled = false;
    this.Dispose(false);
    It has a red squiggly line under MainForm.Show; and the semi colon before it, why is this?

  10. #19
    sam_coder's Avatar
    sam_coder is offline Programming Expert
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    372
    Rep Power
    7

    Re: Splash Screen in C#

    show is a method

    try MainForm.Show();

  11. #20
    sam_coder's Avatar
    sam_coder is offline Programming Expert
    Join Date
    Dec 2010
    Location
    Canada
    Posts
    372
    Rep Power
    7

    Re: Splash Screen in C#

    also for new Form1, you will need
    Form1 MainForm = new Form1();

+ Reply to Thread
Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Java - Splash screen / non rectangular frame.
    By wim DC in forum Classes and Code Snippets
    Replies: 1
    Last Post: 01-16-2011, 07:49 AM
  2. Tutorial - How to create a Splash Screen?
    By diz in forum CSharp Tutorials
    Replies: 9
    Last Post: 11-03-2010, 05:32 AM
  3. Adding a splash screen to your Swing application.
    By farrell2k in forum Java Tutorials
    Replies: 0
    Last Post: 06-20-2010, 04:57 PM
  4. Screen resolution issue and getting rid of gaps around the edges of the screen...
    By HumansAreFriendsNotFood in forum HTML Programming
    Replies: 10
    Last Post: 06-07-2010, 11:07 AM
  5. Timer for splash screen
    By verion24 in forum Visual Basic Programming
    Replies: 3
    Last Post: 07-31-2007, 11:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts