take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetperftechs.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetperftips.asp
I would say yes that is going to cost you .
I would say not minor but not major So somewhere inbetween there
I mean your hitting it every 1/100 of a sec to check a variable
Why not raise an event when the variable changes
meaning
this might require a code change pritty big but would get rid of timer
Public Class Class1
Public WithEvents str As New StringHelper.StringHelper
Public Sub testHelper()
str.SetString("bla")
MsgBox(str.GetString & " Property Return")
End Sub
Public Sub HandleHelperEvent(ByVal ChangedToWhat As String) Handles
str.StringChanged
MsgBox(ChangedToWhat & " This is the event that will be fired on change")
End Sub
End Class
Namespace StringHelper
Public Class StringHelper
Private str As String
Public Event StringChanged(ByVal strChanged As String)
Public Sub SetString(ByVal strInput As String)
Try
str = strInput
RaiseEvent StringChanged(strInput)
Catch ex As Exception
End Try
End Sub
Public Function GetString() As String
GetString = str
End Function
Public Sub New()
str = ""
End Sub
End Class
End Namespace
So now when you set your variable you raise the event instead of the timer
I just try to stay away from timers
If you dont get the file along with the post email me
(e-mail address removed) The file should just be class1.vb. the same code
is posted above. I do not know if you can post files in newsgroups never
tryed.
Another thing you might want to look in to is to add a handler to your
variable. I do not know if this is possible but I think it is.
I think that you variable might need to be an object for this to be
possible.
If you do add a handler to a string please post that code. I would like to
see how it is done.
read up on the addhandler method
Chris