Results 1 to 14 of 14

Thread: Splash Screen

  1. #1

    Thread Starter
    Member rafiki47's Avatar
    Join Date
    Dec 2000
    Location
    Milford MA
    Posts
    43

    Splash Screen

    I am creating a splash screen. After a second i want to put text on it. After another second add some more. Anyone know how to do this?

  2. #2
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Smile

    Use a Timer.

    I think an interval of 1000 is the same as one second.
    ~Peter


  3. #3

    Thread Starter
    Member rafiki47's Avatar
    Join Date
    Dec 2000
    Location
    Milford MA
    Posts
    43
    Yes i use a timer, but i can't figure out the IF statement to use.

  4. #4
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Unhappy

    Since i have no idea what you're doing exactly, i'll give you a general (ie: Basic) idea. You can reformulate as needed.

    This code is for inside the Timer:
    VB Code:
    1. IF iWhatPass = 1 then
    2.     lblText1.text = "first time around"
    3. elseif iWhatPass = 2 then
    4.     lblText2.text = "2nd time"
    5. elseif iWhatPass = 3 then
    6.     lblText3.text = "third pass"
    7.     Timer1.interval = 0
    8. end if
    9.  
    10. iWhatPass +=1
    Above code relies on the fact you have declared this globally: dim iWhatPass as integer =0
    ~Peter


  5. #5
    Lively Member
    Join Date
    Nov 2002
    Location
    Malaysia
    Posts
    124

    How to get a splash screen?

    hello, I'm wondering how to get a splash screen ? Can anyone tell me? I looking for this object for long time.

  6. #6
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    A splash screen isn't something you purchase at a gas station..
    You simply create your splash screens using the classes within the FCL (framework class library).

  7. #7
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    cant you just use a borderless form? (essentially thats all a splashscreen was in VB6)

    btw rafiki47 ...I like your av I created that one 2+ years ago!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  8. #8
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    ok..it works...

    but..heres a few tips:

    to load Form1

    Dim frm as New Form1 'or whatever your next form will be
    frm.Show


    You cant close the splashscreen form w/o closing all forms (since the following forms are "owned" by the splashscreen)
    so.. me.Close() will close all...


    so in the next form...(or the "exit" call)

    Application.Exit seems to work

    I called it in the Form1_Closing sub...
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  9. #9

    Thread Starter
    Member rafiki47's Avatar
    Join Date
    Dec 2000
    Location
    Milford MA
    Posts
    43
    OK.

    So lets see if we can work through this. I created a startup module. here is the code in it.

    Public Sub Main()
    ' Create new splash/Main Forms
    Dim frmNewSplash As New frmSplash()
    Dim frmNewMain As New frmMain()

    ' SHOW Splash Screen
    frmNewSplash.ShowDialog()
    'Now show main form
    frmNewMain.ShowDialog()

    End Sub
    ----------------------------------------------------------------------------------
    Here is the code in the splash screen for the Tick event.

    Private Sub tmrSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSplash.Tick
    Me.Close()
    End Sub
    -----------------------------------------------------------------------------------
    Here is an Example of what i am doing.....

    Private Sub frmSplash_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

    Dim graCurrent As Graphics = e.Graphics
    Dim recCurrent As Rectangle, colCurrent As Color
    Dim sbCurrent As SolidBrush, penCurrent As Pen

    ' Create a rectangle the same size as the form and color it white
    recCurrent = New Rectangle(0, 0, Me.Width, Me.Height)
    sbCurrent = New SolidBrush(Color.White)
    graCurrent.FillRectangle(sbCurrent, recCurrent)

    End Sub
    ---------------------------------------------------------------------------------

    Now what i am trying to accomplish .

    The tick event is set in the properties to 5 seconds. At one second i would like to draw a line. At two seconds do something else. And so on. Could anyone help?


    Thanks

  10. #10
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    Lethal, Mobile is going to begin giving away splash screens with a purchase of 10 gallons or more...

  11. #11
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Sweet!

  12. #12

    Thread Starter
    Member rafiki47's Avatar
    Join Date
    Dec 2000
    Location
    Milford MA
    Posts
    43
    Thanks,
    The posts are very helpful.

  13. #13

    Thread Starter
    Member rafiki47's Avatar
    Join Date
    Dec 2000
    Location
    Milford MA
    Posts
    43
    Anyone?

  14. #14
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    Simple version of what your asking

    Timer interval is set to 1000 (1 sec)

    VB Code:
    1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    2.         Static x As Integer
    3.         If x = 1 Then
    4.             Label1.Text = "Loading."
    5.         End If
    6.         If x = 2 Then
    7.             Label1.Text = "Loading.."
    8.         End If
    9.         If x = 3 Then
    10.             Label1.Text = "Loading..."
    11.         End If
    12.  
    13.         If x = 4 Then
    14.             Label1.Text = "Loading...Form1"
    15.         End If
    16.         If x = 5 Then
    17.             Dim frm As New Form1
    18.  
    19.             frmSplash.ActiveForm.Hide()
    20.             frm.Show()
    21.  
    22.         End If
    23.         x += 1
    24.  
    25.     End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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