G
Guest
I built an application aroung the FileSystemWatcher and i am having trouble
passing a string from my mainForm to a second form toastForm. Can someone
please give me some insight on how to do this. I am a noob to programming so
go easy on me. I have googled searced for 2 days and have yet to find
something that makes sense to me.
Specifically i am wanting to pass string stringEvent to my toastForm
What kind of code do i need to place in my toastForm to acces the stringEvent?
Thanks for your help.
mainForm code
private void myFileWatcher_Deleted(object source,
FileSystemEventArgs e)
{
try
{
ListViewItem item1 = new ListViewItem(e.Name);
item1.SubItems.Add(e.ChangeType.ToString());
item1.SubItems.Add(DateTime.Now.ToShortDateString());
item1.SubItems.Add(DateTime.Now.ToShortTimeString());
listView1.Items.Insert(0, item1);
string stringEvent = e.FullPath.ToString();
showToastForm(stringEvent)
updateStatus(stringEvent);
this.Refresh();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,"Exception",MessageBoxButtons.OK,MessageBoxIcon.Stop);
}
}
private void showToastForm(string stringEvent)
{
tform.Show();
// do i need to put something here to pass string to toastForm?
}
passing a string from my mainForm to a second form toastForm. Can someone
please give me some insight on how to do this. I am a noob to programming so
go easy on me. I have googled searced for 2 days and have yet to find
something that makes sense to me.
Specifically i am wanting to pass string stringEvent to my toastForm
What kind of code do i need to place in my toastForm to acces the stringEvent?
Thanks for your help.
mainForm code
private void myFileWatcher_Deleted(object source,
FileSystemEventArgs e)
{
try
{
ListViewItem item1 = new ListViewItem(e.Name);
item1.SubItems.Add(e.ChangeType.ToString());
item1.SubItems.Add(DateTime.Now.ToShortDateString());
item1.SubItems.Add(DateTime.Now.ToShortTimeString());
listView1.Items.Insert(0, item1);
string stringEvent = e.FullPath.ToString();
showToastForm(stringEvent)
updateStatus(stringEvent);
this.Refresh();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,"Exception",MessageBoxButtons.OK,MessageBoxIcon.Stop);
}
}
private void showToastForm(string stringEvent)
{
tform.Show();
// do i need to put something here to pass string to toastForm?
}