Results 1 to 26 of 26

Thread: [RESOLVED] SplashScreen with ProgressBar

Hybrid View

  1. #1
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: SplashScreen with ProgressBar

    Heres an example:
    VB Code:
    1. Delegate Sub dlgSetInteger(ByVal value As Integer)
    2.  
    3.     Private Sub SetProgressBar1Value(ByVal value As Integer)
    4.         If Me.ProgressBar1.InvokeRequired Then
    5.             Me.ProgressBar1.Invoke(New dlgSetInteger(AddressOf SetProgressBar1Value), New Object() {value})
    6.         Else
    7.             Me.ProgressBar1.Value = value
    8.         End If
    9.     End Sub

    And now, instead of using:
    VB Code:
    1. ProgressBar1.Value = 100
    to set a value, write like this:
    VB Code:
    1. SetProgressBar1Value(100)
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  2. #2

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Re: SplashScreen with ProgressBar

    It dont work I put like this:

    In MainForm (MuShop):
    Delegate Sub dlgSetInteger(ByVal value As Integer)
    Private Sub SetProgressBar1Value(ByVal value As Integer)
    If Entrada.Principal.InvokeRequired Then
    Entrada.Principal.Invoke(New dlgSetInteger(AddressOf SetProgressBar1Value), New Object() {value})
    Else
    Entrada.Principal.Value = value
    End If
    End Sub

    In Search_():
    SetProgressBar1Value(10)

    In MainForm Load:
    Entrada.ShowDialog()
    ByItem_()
    Search_()
    Entrada.Close()
    Me.Show()

    Why doesnt work??!?
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

  3. #3
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: SplashScreen with ProgressBar

    Do you get any errors?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  4. #4

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Re: SplashScreen with ProgressBar

    No But the ProgressBar (Principal) from Entrada doenst "move".

    I'v notice another curious thing if i put this code:
    Entrada.ApplicationTitle.Text = My.Application.Info.Title
    Entrada.Version.Text = System.String.Format(Entrada.Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)
    Entrada.Copyright.Text = My.Application.Info.Copyright
    Entrada.ShowDialog()

    The ApplicationTitle.text, Version.text ... stays good but if i put this code:

    Entrada.ShowDialog()
    Entrada.ApplicationTitle.Text = My.Application.Info.Title
    Entrada.Version.Text = System.String.Format(Entrada.Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)
    Entrada.Copyright.Text = My.Application.Info.Copyright
    The ApplicationTitle.Text ... doens show the correct text. Why?
    Last edited by Lasering; Jun 10th, 2006 at 10:01 AM.
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: SplashScreen with ProgressBar

    You need to replace:

    VB Code:
    1. Entrada.ShowDialog()

    with:

    VB Code:
    1. Entrada.Show()

    Because the lines underneath will not be executed unless entreda is closed, when you use showdialog.

    When using ShowDialog, the form behaves as a dialog, i.e it "pauses" your application until it has been closed.
    Last edited by Atheist; Jun 10th, 2006 at 10:07 AM.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6

    Thread Starter
    Fanatic Member Lasering's Avatar
    Join Date
    May 2006
    Location
    Lisboa
    Posts
    559

    Re: SplashScreen with ProgressBar

    Ok i get a way of the code:
    Entrada.ApplicationTitle.Text = My.Application.Info.Title
    Entrada.Version.Text = System.String.Format(Entrada.Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)
    Entrada.Copyright.Text = My.Application.Info.Copyright

    desapear but now when i put Entrada.show() the progressbar freezes and dont move. And if i put Entrada.Showdialog() the progressbar moves but the labels stay like transparents

    How can i have the progressbar and the labels working good?
    Controls: XPCC|Quantum
    Windows API'sLINQ to XML SamplesRegex Tutorial

    Albert Einstein:
    "Imagination is more important than knowledge."
    "Everything should be made as simple as possible, but not simpler."
    "Great spirits have often encountered violent opposition from weak minds."

  7. #7
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: SplashScreen with ProgressBar

    wrap your code in a try statement

    Like this:

    VB Code:
    1. Try
    2.             'Put your code here
    3.         Catch ex As Exception
    4.             MessageBox.Show(ex.Message)
    5.         End Try

    And let's see what it says.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

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