Results 1 to 3 of 3

Thread: Setting splash screen time

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Setting splash screen time

    I'm trying to set the splash screen minimum display time per https://learn.microsoft.com/en-us/do...owsdesktop-8.0

    Where do I put this code?

    Code:
    Protected Overrides Function OnInitialize(commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of string)) As Boolean
        ' Set the display time to 5000 milliseconds (5 seconds). 
        Me.MinimumSplashScreenDisplayTime = 5000
        Return MyBase.OnInitialize(commandLineArgs)
    End Function

    I tried it in my main form & in ApplicationEvents & both give me errors...
    Last edited by nbrege; Dec 29th, 2023 at 01:14 PM.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Setting splash screen time

    Did you keep reading? Because it tells you where: (emphasis mine)....
    You should set the My.Application.MinimumSplashScreenDisplayTime property in a method that overrides the OnInitialize or OnCreateSplashScreen method. Code that overrides methods of the WindowsFormsApplicationBase class should be entered in the ApplicationEvents.vb file, which is hidden by default.
    And then provides instructions for getting to the hidden file:
    To access the Code Editor window for overriding members
    1. With a project selected in Solution Explorer, click Properties on the Project menu.
    2. Click the Application tab.
    3. Click the View Application Events button to open the Code Editor.
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Setting splash screen time

    Quote Originally Posted by nbrege View Post
    I tried it in my main form & in ApplicationEvents & both give me errors...
    The first option is obviously wrong, as per the documentation quoted by tg, but it sounds like the second may be correct. Alas, I just can't think of a way that we could ever discover what those errors actually were in order to diagnose the issue. If only there was someone who had that information already and could provide it to us.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width