Hey there.
First of all, let me say i'm relatively new to .NET.
Anyways, I'm making a program that searches IMDB online for the episode list.
Since the program access the web, it takes ages sometimes to actually complete a task. I wanted to inform the user that the program is still busy and he will have to pantiently wait and so I added a StatusLabel in the StatusStrip.
The problem is that that the Status isn't updated while computer is... humm... "thinking".
Here's the piece of code:
If I actually add a line like msgbox("something") the status is upgraded, ut if I don't the label isn't and remains saying "Ready".
I can easily workaround this, like warpping the code in a sub and point the buttonclick event to run that sub.
But my main goal is to understand why the status isn't updated if it appears before the rest of the code.
First of all, let me say i'm relatively new to .NET.
Anyways, I'm making a program that searches IMDB online for the episode list.
Since the program access the web, it takes ages sometimes to actually complete a task. I wanted to inform the user that the program is still busy and he will have to pantiently wait and so I added a StatusLabel in the StatusStrip.
The problem is that that the Status isn't updated while computer is... humm... "thinking".
Here's the piece of code:
VB.NET:
Private Sub Search_IMDB_URL_CNP_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search_IMDB_URL_CNP_Button.Click
StatusLabel_CNP.Text = "Busy"
' If I insert a line like
' MsgBox("some text!")
' The status is actually upgraded
If Series_Name_CNP_TB.Text = "" Then
Series_Name_CNP_TB.Text = InputBox("Series Name Field is empty. Please input a name and click 'Search' again", "Series Name Missing")
Series_Name_CNP_TB.Text = Series_Name_CNP_TB.Text.Trim
Else
Dim IMDBQuery As New IMDB.SearchMode(Series_Name_CNP_TB.Text)
If IMDBQuery.NumberOf_SearchMatchesFound = 0 Then
MsgBox("No matches found!")
IMDB_URL_CNP_TB.Text = ""
StatusLabel_CNP.Text = "Ready"
Exit Sub
End If
If IMDBQuery.NumberOf_SearchMatchesFound = 1 Then
IMDB_URL_CNP_TB.Text = IMDBQuery.EpisodeListPage_URL
Else
Dim Search_IMDB_form As New SearchIMDB_Dialog(Series_Name_CNP_TB.Text, IMDBQuery.NumberOf_SearchMatchesFound)
If Search_IMDB_form.ShowDialog(Me) = DialogResult.OK Then IMDB_URL_CNP_TB.Text = Search_IMDB_form.IMDB_URL_SID
End If
End If
StatusLabel_CNP.Text = "Ready"
End Sub
If I actually add a line like msgbox("something") the status is upgraded, ut if I don't the label isn't and remains saying "Ready".
I can easily workaround this, like warpping the code in a sub and point the buttonclick event to run that sub.
But my main goal is to understand why the status isn't updated if it appears before the rest of the code.