|
-
Sep 24th, 2003, 09:01 AM
#1
Thread Starter
Fanatic Member
timer
Hi everyone,
While a process is running I would like the statusbar1.text to blink on shwing a message such as "Processing..."
I have two timers. Timer 1 is set to 1000 interval and timer 2 to 500 interval
both are enabled.
while debugging I can see that they are both been read but the data does not get displayed may be it is because there is no time for the statusbar1 to be refreshed. And I believe I may be able to use something like doevents. but doevents does not work in vb.net ?
Any ideas?
Thanks
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
StatusBar1.Text = "Processing Data. Please wait..."
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
StatusBar1.Text = ""
End Sub
-
Sep 24th, 2003, 09:19 AM
#2
Thread Starter
Fanatic Member
It still does not work...
I have the following in the code
The property, enabled for the timer is set to false, the interval is 500
'Run the process as a separate thread...
Private t As New Thread(AddressOf Me.PopulateExcel)
Private Sub btnExcelStrategies_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExcelStrategies.Click
t.Start() 'populates excel in a separate thread, to prevent locking...
End Sub
private sub PopulateExcel()
'''populates excel cells... this takes about 10 minutes to complete...
End Sub
Private Sub EnableTimer()
Timer1.Enabled = True
End Sub
Private Sub DisableTimer()
Timer1.Enabled = False
StatusBar1.Text = ""
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Application.DoEvents()
If StatusBar1.Text = "" Then
StatusBar1.Text = "Processing Data..."
Else
StatusBar1.Text = ""
End If
End Sub
Last edited by fmardani; Sep 24th, 2003 at 11:26 AM.
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
|