14 Replies - 11324 Views - Last Post: 10 June 2010 - 02:05 AM Rate Topic: -----

#1 imraan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-April 10

Problems With splash screen

Posted 28 April 2010 - 01:40 AM

Hello everybody,
i am creating a vb application & having problems in splash screen.
I added a splash screen but wenever i run the application, it stays for less den a second.
WHat should i do. Please help me.

Thnx in advance. :helpsmilie:



Is This A Good Question/Topic? 0
  • +

Replies To: Problems With splash screen

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Problems With splash screen

Posted 28 April 2010 - 03:54 AM

can we see the code where you show your splash screen. you can use a sleep to stay for longer (the time you want) before switching to your main form
Was This Post Helpful? 0
  • +
  • -

#3 imraan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-April 10

Re: Problems With splash screen

Posted 28 April 2010 - 07:48 AM

name of my splash screen is welcum.vb
on double clicking on splash screen..i got the following code.

Public NotInheritable Class welcum

    'TODO: This form can easily be set as the splash screen for the application by going to the "Application" tab
    '  of the Project Designer ("Properties" under the "Project" menu).


    Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Set up the dialog text at runtime according to the application's assembly information.  

        'TODO: Customize the application's assembly information in the "Application" pane of the project 
        '  properties dialog (under the "Project" menu).

        'Application title
        If My.Application.Info.Title <> "" Then
            ApplicationTitle.Text = My.Application.Info.Title
        Else
            'If the application title is missing, use the application name, without the extension
            ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If

        'Format the version information using the text set into the Version control at design time as the
        '  formatting string.  This allows for effective localization if desired.
        '  Build and revision information could be included by using the following code and changing the 
        '  Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar.  See
        '  String.Format() in Help for more information.
        '
        '    Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

        Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)

        'Copyright info
        Copyright.Text = My.Application.Info.Copyright
    End Sub

    
End Class


Was This Post Helpful? 0
  • +
  • -

#4 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Problems With splash screen

Posted 28 April 2010 - 08:08 AM

you can use sleep as i say something like so
Public NotInheritable Class welcum

    'TODO: This form can easily be set as the splash screen for the application by going to the "Application" tab
    '  of the Project Designer ("Properties" under the "Project" menu).


    Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Set up the dialog text at runtime according to the application's assembly information.  

        'TODO: Customize the application's assembly information in the "Application" pane of the project 
        '  properties dialog (under the "Project" menu).

        'Application title
        If My.Application.Info.Title <> "" Then
            ApplicationTitle.Text = My.Application.Info.Title
        Else
            'If the application title is missing, use the application name, without the extension
            ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If

        'Format the version information using the text set into the Version control at design time as the
        '  formatting string.  This allows for effective localization if desired.
        '  Build and revision information could be included by using the following code and changing the 
        '  Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar.  See
        '  String.Format() in Help for more information.
        '
        '    Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

        Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)

        'Copyright info
        Copyright.Text = My.Application.Info.Copyright
        'HERE SLEEP THE PROGRAM FOR 1 second (1000 milliseconds)'
        System.Threading.Thread.Sleep(1000)

    End Sub

    
End Class


This post has been edited by NoBrain: 28 April 2010 - 08:09 AM

Was This Post Helpful? 0
  • +
  • -

#5 imraan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-April 10

Re: Problems With splash screen

Posted 28 April 2010 - 09:45 AM

after putting the SLEEP code...it creates another problem...
wen i run d application it shows d main screen for 5 seconds & after that the splash screen comes for fraction of a second (like earlier)...& den goes away..

what should i do now Sir ?

not "main screen". my mistake ..its frmMain (main form of my application)
Was This Post Helpful? 0
  • +
  • -

#6 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Problems With splash screen

Posted 28 April 2010 - 10:10 AM

can we see your frmMain code where you call the splash screen

This post has been edited by NoBrain: 28 April 2010 - 10:27 AM

Was This Post Helpful? 0
  • +
  • -

#7 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2263
  • View blog
  • Posts: 9,468
  • Joined: 29-May 08

Re: Problems With splash screen

Posted 28 April 2010 - 10:39 AM

Or go to your Application's Properties -> Application Settings -> set Splash Screen to your Splash Form.

The in the Solution Explorer make sure Show all Files is enabled.
Navigate to Application.MyApp -> Application.Designer.vb
The Change
   
 <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
 Protected Overrides Sub OnCreateSplashScreen()
   My.Application.MinimumSplashScreenDisplayTime = 10000
 End Sub


To
 <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
 Protected Overrides Sub OnCreateSplashScreen()
   ' Display Splash Screen for a least 10000 ms (10 Secs) '
   My.Application.MinimumSplashScreenDisplayTime = 10000
   Me.SplashScreen = Global.WindowsApplication1.Form2
 End Sub


Was This Post Helpful? 1
  • +
  • -

#8 rath2424  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 19
  • Joined: 17-December 08

Re: Problems With splash screen

Posted 28 April 2010 - 11:46 AM

can't you just go in the box and set it as double click then it will go away? you don't need a sleep timer.
Was This Post Helpful? 1
  • +
  • -

#9 imraan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-April 10

Re: Problems With splash screen

Posted 28 April 2010 - 08:21 PM

This is tha Application.designer.vb
i made the changes...still the problem is there..


------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:2.0.50727.1433
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On


Namespace My
    
    'NOTE: This file is auto-generated; do not modify it directly.  To make changes,
    ' or if you encounter build errors in this file, go to the Project Designer
    ' (go to Project Properties or double-click the My Project node in
    ' Solution Explorer), and make changes on the Application tab.
    '
    Partial Friend Class MyApplication
        
        <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
        Public Sub New()
            MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
            Me.IsSingleInstance = false
            Me.EnableVisualStyles = true
            Me.SaveMySettingsOnExit = true
            Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
        End Sub
        
        <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
        Protected Overrides Sub OnCreateMainForm()
            Me.MainForm = Global.ImuFrnz.frmMain
        End Sub
        
        <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
        Protected Overrides Sub OnCreateSplashScreen()
            Me.SplashScreen = Global.ImuFrnz.welcum
            ' Display Splash Screen for a least 5000 ms (5 Secs) '
            My.Application.MinimumSplashScreenDisplayTime = 5000
            Me.SplashScreen = Global.ImuFrnz.welcum
        End Sub

    End Class
End Namespace


the unfinished code of my mainform is as follows.

recommend changes if you find other errors sir..



Public Class frmMain

    Private Sub GETLOSTToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GETLOSTToolStripMenuItem.Click
        On Error Resume Next
        ActiveMdiChild.Dispose()
        Dim FRM As New FrmShutDown
        FRM.Show()
    End Sub

    Private Sub PersonalInformationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PersonalInformationToolStripMenuItem.Click
        On Error Resume Next
        ActiveMdiChild.Dispose()
        Dim FRM As New frmPILogin
        FRM.Show()
    End Sub

    Private Sub AboutToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem1.Click
        Dim FRM As New AboutID
        FRM.Show()
    End Sub

    Private Sub AboutDeveloperToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutDeveloperToolStripMenuItem.Click
        Dim FRM As New AboutImraan
        FRM.Show()
    End Sub

    Private Sub MyIDPasswordsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyIDPasswordsToolStripMenuItem.Click
        On Error Resume Next
        ActiveMdiChild.Dispose()
        Dim FRM As New frmIdLogin
        FRM.MdiParent = Me
        'FRM.WindowState = FormWindowState.Maximized
        FRM.Show()
        Me.Enabled = False
        frmIdLogin.Show()
    End Sub

    Private Sub tmrDateShow_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrDateShow.Tick
        lbltime.Text = Now
    End Sub

    Private Sub SchoolBuddiezToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SchoolBuddiezToolStripMenuItem.Click
        On Error Resume Next
        ActiveMdiChild.Dispose()
        Dim FRM As New frmSkulFrnz
        FRM.Show()
    End Sub

    Private Sub CITCDudesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CITCDudesToolStripMenuItem.Click
        On Error Resume Next
        ActiveMdiChild.Dispose()
        Dim FRM As New frmCITCfrnz
        FRM.Show()
    End Sub

    Private Sub HostelDudesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HostelDudesToolStripMenuItem.Click
        On Error Resume Next
        ActiveMdiChild.Dispose()
        Dim FRM As New frmBVMfrnz
        FRM.Show()
    End Sub

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

Was This Post Helpful? 0
  • +
  • -

#10 imraan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-April 10

Re: Problems With splash screen

Posted 28 April 2010 - 08:28 PM

i also have a problem wit timer...
i put a level in my mainform to show the current time...
but its not showing the time...
please correct me..

Thnx in advance
Was This Post Helpful? 0
  • +
  • -

#11 imraan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-April 10

Re: Problems With splash screen

Posted 28 April 2010 - 10:06 PM

timer problem partially solved...shows time in level...i called it wen mainform loads. but the problem is that it shows the time of that particular momment only. it doesnt update time.

help please

This post has been edited by imraan: 28 April 2010 - 10:08 PM

Was This Post Helpful? 0
  • +
  • -

#12 imraan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-April 10

Re: Problems With splash screen

Posted 30 April 2010 - 04:20 AM

?????????????
Was This Post Helpful? 0
  • +
  • -

#13 Ahud07  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 29-April 10

Re: Problems With splash screen

Posted 30 April 2010 - 05:16 PM

If you use a DateTimePicker you can set it as DateControl.Value = Today() and it will go off of your computers date
Was This Post Helpful? 0
  • +
  • -

#14 nozleaf  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-June 10

Re: Problems With splash screen

Posted 10 June 2010 - 01:01 AM

What version of Vb are you using. Like 2010 Express of 2008 Express.
Was This Post Helpful? 0
  • +
  • -

#15 Luc001  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 617
  • Joined: 04-May 09

Re: Problems With splash screen

Posted 10 June 2010 - 02:05 AM

Hi imraan,

This is how I used a splashscreen ones:

Add a splash screen and make it startup form
In the same properties select shutdown mode as : When last form closes
Add a windows form: form1
Add a timer and set enabled to true and interval 4000
Then try this:

Public NotInheritable Class SplashScreen1
    
' When the splash Screen is closed the Form1 will showing
    Private Sub SplashScreen1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Dim fr As New Form1
        fr.Show()
    End Sub
    

    'TODO: This form can easily be set as the splash screen for the application by going to the "Application" tab
    '  of the Project Designer ("Properties" under the "Project" menu).


    Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Set up the dialog text at runtime according to the application's assembly information.  

        'TODO: Customize the application's assembly information in the "Application" pane of the project 
        '  properties dialog (under the "Project" menu).

        'Application title
        If My.Application.Info.Title <> "" Then
            ApplicationTitle.Text = My.Application.Info.Title
        Else
            'If the application title is missing, use the application name, without the extension
            ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If

        'Format the version information using the text set into the Version control at design time as the
        '  formatting string.  This allows for effective localization if desired.
        '  Build and revision information could be included by using the following code and changing the 
        '  Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar.  See
        '  String.Format() in Help for more information.
        '
        '    Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

        Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)

        'Copyright info
        Copyright.Text = My.Application.Info.Copyright

    End Sub

 ' The timer event fires after 4 sec and closes the splash screen.
 ' In the splash screen closed event, you saw before will open the next 
 ' form, Form1

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Timer1.Enabled = False

        DialogResult = DialogResult.OK

        Me.Close()


    End Sub
End Class



Just to show you how I did it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1