updating parent form from child object
-
Using C#.net express edition I created an application that has the main code in the parent form. In this form I create an object and I want that object to change values in the parent form before the object returns a value (I am doing a progressbar). I could create a form object from the child object but that would not look as nice. HELP! shwa guy
-
Using C#.net express edition I created an application that has the main code in the parent form. In this form I create an object and I want that object to change values in the parent form before the object returns a value (I am doing a progressbar). I could create a form object from the child object but that would not look as nice. HELP! shwa guy
shwaguy wrote:
Using C#.net express edition I created an application that has the main code in the parent form. In this form I create an object and I want that object to change values in the parent form before the object returns a value (I am doing a progressbar). I could create a form object from the child object but that would not look as nice.
Either have your object fire progress events, which you can wire and use to update your
ProgressBar
from the main form, or pass theProgressBar
to the object and have it do the update directly. The first method is more code, but vastly preferrable. If your object uses threads, beware of UI marshalling issues. Share and enjoy. Sean -
shwaguy wrote:
Using C#.net express edition I created an application that has the main code in the parent form. In this form I create an object and I want that object to change values in the parent form before the object returns a value (I am doing a progressbar). I could create a form object from the child object but that would not look as nice.
Either have your object fire progress events, which you can wire and use to update your
ProgressBar
from the main form, or pass theProgressBar
to the object and have it do the update directly. The first method is more code, but vastly preferrable. If your object uses threads, beware of UI marshalling issues. Share and enjoy. Sean