Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 01-17-2006, 10:15 AM   #1
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Visual Basic .net Splash Screen

Hi all. I am trying to make a Splash Screen in VB net. I have completed the screen its self, but i need a snippet of code to make it only stay on the screen for 5 seconds.... I think it is a really simple piece of code, but since i only started yesterday, i dont know here to look to get it. Thanks in advance, samurai.
__________________

j03 is offline   Reply With Quote
Old 01-17-2006, 11:17 AM   #2
Fully Optimized
 
Dishdog's Avatar
 
Join Date: Feb 2005
Posts: 2,801
Default Re: Visual Basic .net Splash Screen

-Make a timer and set the interval to "1000"(1000=1sec). make a counter in the
general (Dim counter As Byte).
-Put counter = 0 in form load
-Now in the timer sub enter:

counter = counter +1 ' Every second the timer will add one to the counter
if counter = 5 then
frmSplash.visible = false 'What ever you named your splash screen
frmMain.visible = true ' Whatever you named your screen after the splash
end if
__________________

__________________
CPU-Intel Pentium 4 630 3.0Ghz / 2MB Cache ~~OS Windows XP SP2
MOBO-Gigabyte 8I915P Duo Pro Intel Socket 775 (PCI-E)~~HDD-Western Digital 160GB(SATA)
PSU-Aspire 500W ATX~~RAM-1GB PC3200 DDR SDRAM (512x2 Dual Channel)
GPU-MSI GeForce 6600 GT(PCI Express)~~Monitor Viewsonic VA902B 19" 8ms~~ ATI TV Wonder Pro (TV Tuner)
~~Still to come~~: eVGA e-GeForce 7800 GT
Dishdog is offline   Reply With Quote
Old 01-17-2006, 12:10 PM   #3
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: Visual Basic .net Splash Screen

Err.... Can i give you the code for the splash? ( i am not sure how to do all that, but thanks)


Code:
Public NotInheritable Class splash

	'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 splash_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

	Private Sub ApplicationTitle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ApplicationTitle.Click

	End Sub






	Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

	End Sub
End Class
j03 is offline   Reply With Quote
Old 01-18-2006, 12:23 AM   #4
Fully Optimized
 
Dishdog's Avatar
 
Join Date: Feb 2005
Posts: 2,801
Default Re: Visual Basic .net Splash Screen

Not really sure where my VB6 stuff goes in your .net,lol.

VB6
Code:
Dim Counter As Byte

Private Sub Form_Load()
Counter = 0
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
Counter = Counter + 1
If Counter = 5 Then 'Replace 5 with the amount of seconds you want the splash to show
frmSplash.Visible = Flase 'Replace frmSplash with whatevr you called your splash screen
frmMain.Visible = True    ' Replace frmMain with whatever form you want to go to after your splash
End If
End Sub
This is for VB6(didn't read you wanted in for VB.net till after) but i would imagine it's almost the same for VB.net or at least the same consept.
__________________
CPU-Intel Pentium 4 630 3.0Ghz / 2MB Cache ~~OS Windows XP SP2
MOBO-Gigabyte 8I915P Duo Pro Intel Socket 775 (PCI-E)~~HDD-Western Digital 160GB(SATA)
PSU-Aspire 500W ATX~~RAM-1GB PC3200 DDR SDRAM (512x2 Dual Channel)
GPU-MSI GeForce 6600 GT(PCI Express)~~Monitor Viewsonic VA902B 19" 8ms~~ ATI TV Wonder Pro (TV Tuner)
~~Still to come~~: eVGA e-GeForce 7800 GT
Dishdog is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 03:38 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0