Hi all,
I'm using a FileSystemWatch er to monitor a directory. I want the FSW
to pop up my already instantiated but invisible form.
However, I'm running into some problems with this.
1) In the FSW.Changed FileSystemEvent handler, I called the Show method
'frmMain.Show( )' on my form, the form appears but not completely
painted and it appears to be hanging with the hourglass.
private void OnCreated( )
{
frmMain.Show( );
//update the datasource, append to DataTable
}
2) Once I have my form fully painted and not hanging, I want the FSW
to continue communicating with the now visible form relaying
information about the incoming files. See, on the form I have a
DataGridView that has as its datasource a Datatable that is appended
to by the FSW in the OnChanged event above.
I have 2 main classes: FORM and MASTER. the FORM class is self
explanatory. The MASTER class inherits from the ApplicationCont ext
class. This is where the FSW is located. I do this to show the form
only when new files are detected by the FSW.
Anyone have any ideas or am able to shed some light on these
questions?
Any help is much appreciated.
public static void Main( )
{
Application.Run (new MASTER( ) );
}
public class MASTER : ApplicationCont ext
{
private System.IO.FileS ystemWatcher;
...
}
public class FORM : Form
{
public System.Data.Dat aTable dt;
...
}