ClioSport.net

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • Due to ongoing maintenance work some features and functions (including Dark mode!) may be unavailable or visually appear differently.
  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Any Visual Basic Programmers???

Car  Bumder With A Buffer
Im after a bit of advice really!!

Im trying to make a splash screen startup on a bit of software and am struggling to get it to work correctly. Now i must say im very new to this programming stuff so please be gentle!!!

Or is anyone willing to take a look at the code to see what im doing wrong?? Its something i wrote for myself!
 
Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)
Unload Me
End Sub

Private Sub Form_Load()
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
lblProductName.Caption = App.Title
End Sub

Private Sub btnProceed_Click()
Unload Me
End Sub

^^^^^^^^^^^^

Thats what i had and i couldnt figure out why my other form wasnt loading! Then I did this

Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)
Unload Me
End Sub

Private Sub Form_Load()
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
lblProductName.Caption = App.Title
End Sub

Private Sub btnProceed_Click()
Unload Me
frmResults.Show
End Sub

^^^^^^^^
And by adding the "frmResults.show" call i sorted it!!!

A question though... I have the splash screen set so i click a button to exit it and load up my next form.... How would i incoporate a timer function into the above?
 
use as a count down in a label like

Private Sub Form_Load()
Timer1.Interval = 1000
Label1.Caption = "100"
End Sub

Private Sub Timer1_Timer()
if label1.caption = 0 then
timer1.enabled = false
msgbox ("100 secs is up")
else
Label1.Caption = label1.caption - 1
end if
End Sub
 
Assuming an Enabled Timer on your splash screen with an Interval of 1000 (1 second), something like this would keep your splash screen visible for 5 seconds.

Dim iSecs As Integer

Private Sub Timer1_Timer()
If iSecs = 5 Then
Timer1.Enabled = False
Unload Me
End If
iSecs = iSecs + 1
End Sub
 
Back
Top