hshot_rooke
New member
- Joined
- Sep 4, 2008
- Messages
- 4
- Programming Experience
- 5-10
Hello fellow developers
Using Visual Studio 2008.
I have a question regarding the FileSystemWatcher.
I'm trying to load an MDI child inside a parent on the "created" event of my FileSystemWatcher. The code runs through fine, but the MDI child never shows inside the parent. If I have a separate button on the toolbar of my application, the MDI child shows up fine.
Is this a bug in VS2008? Seems very straightforward, but the child never shows. Debugging the application, it hits all the events fine and runs through all the code fine without exceptions, but never actually does anything.
Any help on this situation would be greatly appreciated. Thank you.
Sample code:
Using Visual Studio 2008.
I have a question regarding the FileSystemWatcher.
I'm trying to load an MDI child inside a parent on the "created" event of my FileSystemWatcher. The code runs through fine, but the MDI child never shows inside the parent. If I have a separate button on the toolbar of my application, the MDI child shows up fine.
Is this a bug in VS2008? Seems very straightforward, but the child never shows. Debugging the application, it hits all the events fine and runs through all the code fine without exceptions, but never actually does anything.
Any help on this situation would be greatly appreciated. Thank you.
Sample code:
VB.NET:
Private Sub MDIParent1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Initalize_Watcher()
End Sub
Private Sub Initalize_Watcher()
Dim toWatch As String = String.Empty
toWatch = "C:\PFEX Test\Interface Output"
If Not toWatch.Equals(String.Empty) Then
_Fsw = New System.IO.FileSystemWatcher(toWatch, "*.pfx")
_Fsw.EnableRaisingEvents = True
End If
End Sub
Private Sub _Fsw_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles _Fsw.Created
With My.Forms.Form1
.WindowState = FormWindowState.Maximized
.Show()
.Activate()
End With
End Sub