|
-
Jun 10th, 2006, 07:55 AM
#1
Re: SplashScreen with ProgressBar
Heres an example:
VB Code:
Delegate Sub dlgSetInteger(ByVal value As Integer)
Private Sub SetProgressBar1Value(ByVal value As Integer)
If Me.ProgressBar1.InvokeRequired Then
Me.ProgressBar1.Invoke(New dlgSetInteger(AddressOf SetProgressBar1Value), New Object() {value})
Else
Me.ProgressBar1.Value = value
End If
End Sub
And now, instead of using:
to set a value, write like this:
VB Code:
SetProgressBar1Value(100)
-
Jun 10th, 2006, 09:10 AM
#2
Thread Starter
Fanatic Member
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??!?
-
Jun 10th, 2006, 09:25 AM
#3
Re: SplashScreen with ProgressBar
-
Jun 10th, 2006, 09:55 AM
#4
Thread Starter
Fanatic Member
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.
-
Jun 10th, 2006, 10:03 AM
#5
Re: SplashScreen with ProgressBar
You need to replace:
with:
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.
-
Jun 10th, 2006, 10:40 AM
#6
Thread Starter
Fanatic Member
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?
-
Jun 10th, 2006, 10:52 AM
#7
Re: SplashScreen with ProgressBar
wrap your code in a try statement
Like this:
VB Code:
Try
'Put your code here
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
And let's see what it says.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|