Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. updating parent form from child object

updating parent form from child object

Scheduled Pinned Locked Moved C#
csharphelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shwaguy
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • S shwaguy

      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

      S Offline
      S Offline
      Sean Michael Murphy
      wrote on last edited by
      #2

      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 the ProgressBar 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

      S 1 Reply Last reply
      0
      • S Sean Michael Murphy

        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 the ProgressBar 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

        S Offline
        S Offline
        shwaguy
        wrote on last edited by
        #3

        thanks for the reply. I still do not know how do what I need to do, but I think I might be on the right path now. I never had to fire events before, I guess I am about to learn. shwa guy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups