F
Funnyman
I'm pretty new to .net Windows Forms, but I've done a lot of searching
and can't find an answer to this question. Here's what I'm trying to
do:
main() {
Form1 myForm = new Form1();
Application::Run(myForm);
}
Function1()
{
// I need to modify elements of myForm either
// through a class function or by manipulating the
// object itself.
return;
}
Basically the app has the main window thread (Application::Run) and
then a listener thread for events coming in from other applications,
and those events need to manipulate the data being shown in the main
window.
Right now, I have hacked it up so that I have a static Form1 pointer
in the Form1 class, and whenever an event is received I do the
following:
Form1::thisForm->Function();
but, like I said, this feels like a hack.
Any suggestions as to the correct way of doing this would be greatly
appreciated. Thanks very much!
--Mike
and can't find an answer to this question. Here's what I'm trying to
do:
main() {
Form1 myForm = new Form1();
Application::Run(myForm);
}
Function1()
{
// I need to modify elements of myForm either
// through a class function or by manipulating the
// object itself.
return;
}
Basically the app has the main window thread (Application::Run) and
then a listener thread for events coming in from other applications,
and those events need to manipulate the data being shown in the main
window.
Right now, I have hacked it up so that I have a static Form1 pointer
in the Form1 class, and whenever an event is received I do the
following:
Form1::thisForm->Function();
but, like I said, this feels like a hack.
Any suggestions as to the correct way of doing this would be greatly
appreciated. Thanks very much!
--Mike