HI
This is shailendra.I am using
vb 2005 to develop a stock market charting product.
The chart needs to be updated every 5 min or when the data of the specific company gets updated.
To update the chart i have applied filesystemwatcher to do the same.
The problem i am facing is ,when i am trying to open a new window the updation of last highlighted window is disturbed.I cant get the actual problem occuring with the last highlighted window coz the oher unhighlighted windows get updated .
The code i have used is
#Region "Tick update"
'Procedure to watch the fil with the fom's name
Private Sub watchnupdate()
' Create a new FileSystemWatcher and set its properties.
Dim watcher As New FileSystemWatcher()
fs = New FileStream("intrapath.ini", FileMode.Open, FileAccess.Read)
strread = New StreamReader(fs)
watcher.Path = strread.ReadLine.Trim & "\Intra5min"
strread.Close()
fs.Dispose()
' Watch for changes in LastAccess and LastWrite times, and
' the renaming of files or directories.
watcher.NotifyFilter = (NotifyFilters.LastAccess Or NotifyFilters.LastWrite)
' Only watch text files.
watcher.Filter = Me.Name & ".txt" 'applied for specific watch
' Add event handlers.
AddHandler watcher.Changed, AddressOf OnChanged
' Begin watching.
watcher.EnableRaisingEvents = True
End Sub
' Define the event handlers.
Private Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)
' Specify what is done when a file is changed, created, or deleted.
scrolled = True 'This variable is reset to true to draw all the indicators aplied on the chart.
drawChart(winChartViewer1) 'to redraw the chart
End Sub
#End Region
Shailendra