vb.net system tray app - slow response time when viewing form

D

dk

Any idea why the response time is slow when running
a system tray app when viewing the properties form?
There is one primary loop and a timer control which
executes every 3minutes. Is having the Primary loop the
problem?

tia,
dk


'Primary loop
Do While Me.mbRunning
With Me.tryIcon
If RTrim(strstatus$) = "" Then strstatus$
= "The first refresh interval is cycling, please stand by"
.Text = strstatus$
.ContextMenu = Me.mnuOptions
End With
Dim temppathstring As String = AppPath()
Dim tempconfigfile As New configfile
(temppathstring + "\triggerwatch.config")
System.Threading.Thread.Sleep
(tempconfigfile.GetAppSetting("spinratekey") * 100)
Application.DoEvents()
If tempconfigfile.GetAppSetting
("animateiconkey") = "true" Then
Me.AnimateIcon()
Else
Me.DoNotAnimateIcon()
End If
temppathstring = Nothing
tempconfigfile = Nothing
Loop
 
C

Chris Dunaway

Any idea why the response time is slow when running
a system tray app when viewing the properties form?
There is one primary loop and a timer control which
executes every 3minutes. Is having the Primary loop the
problem?

tia,
dk


'Primary loop
Do While Me.mbRunning
With Me.tryIcon
If RTrim(strstatus$) = "" Then strstatus$
= "The first refresh interval is cycling, please stand by"
.Text = strstatus$
.ContextMenu = Me.mnuOptions
End With
Dim temppathstring As String = AppPath()
Dim tempconfigfile As New configfile
(temppathstring + "\triggerwatch.config")
System.Threading.Thread.Sleep
(tempconfigfile.GetAppSetting("spinratekey") * 100)
Application.DoEvents()
If tempconfigfile.GetAppSetting
("animateiconkey") = "true" Then
Me.AnimateIcon()
Else
Me.DoNotAnimateIcon()
End If
temppathstring = Nothing
tempconfigfile = Nothing
Loop

I'm not sure what the purpose of the loop is. Is it to cause the tray icon
to be animated? That could easily be accomplished with a timer, and
probably more efficiently as well. A tight loop can certainly cause slow
response time, but without knowing more about your application, it's
difficult to tell.

What is "Me"? Does that refer a form? A component?

I think some more information about the structure of your app would be
helpful.
 
Top