G
Guest
Hello, hopefully I can describe this probably correctly.
I have what I thought was a simply form that opens a popup (another form)
whenever an event happens. My main form, Form A, has an instance of Form B
created on it. I set a bunch of parameters and then call a method on Form B
to show itself and do a few more things. I can get the event to fire correct
by pressing a button; everything was working great.
However, I'm now trying to add in a class file that will check an XML stream
over and over. If that xml file changes, I need the popup from above to open
up to alert the user that something has changed. I fire off a thread, but of
course I can't open the popup from the thread due to the cross-thread error.
So basically, I have Form A (the main form), which calls Form B to open
(Form A also sets some parameters on the 2nd form). I wish to access the
instance of Form B that is running on Form A from Class C. I've looked in to
delegates and invoking, but I guess I'm just totally lost about what goes
where. I've also tried creating a worker class and just open up Form B
directly from Class C, but that doesn't work very well and it's not the ideal
solution anyway.
Any tips? I've googled quite a bit, but I'm still scratching my head.
Frij
I have what I thought was a simply form that opens a popup (another form)
whenever an event happens. My main form, Form A, has an instance of Form B
created on it. I set a bunch of parameters and then call a method on Form B
to show itself and do a few more things. I can get the event to fire correct
by pressing a button; everything was working great.
However, I'm now trying to add in a class file that will check an XML stream
over and over. If that xml file changes, I need the popup from above to open
up to alert the user that something has changed. I fire off a thread, but of
course I can't open the popup from the thread due to the cross-thread error.
So basically, I have Form A (the main form), which calls Form B to open
(Form A also sets some parameters on the 2nd form). I wish to access the
instance of Form B that is running on Form A from Class C. I've looked in to
delegates and invoking, but I guess I'm just totally lost about what goes
where. I've also tried creating a worker class and just open up Form B
directly from Class C, but that doesn't work very well and it's not the ideal
solution anyway.
Any tips? I've googled quite a bit, but I'm still scratching my head.
Frij