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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. A little help with MDIParent event process.....

A little help with MDIParent event process.....

Scheduled Pinned Locked Moved C#
questiondatabasehelp
2 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.
  • L Offline
    L Offline
    LongRange Shooter
    wrote on last edited by
    #1

    Hokay Dokay.... I have an MDIParent with a controller window on the side. The controller window creates the instances of the MDIChild forms and defines the MDIParent as the parent of the children. So far so good. All works just dandy -- including managing multiple instances, etc. Now -- the next enhancement to the app. I need to do processing on the children AFTER they have been created. What I want to do is this: Delegate an event in my parent form to do the after-creation process. Have my children raise the event once the form has been loaded. The question is this: Is there a GOOD existing event I can use to accomplish this that guarantees me that only the children raising the event will trigger the event, or should I define my own event to handle it? I want to make sure that normal window process does not fire this event since what I have to do is rather intense processing! I was thinking of reusing the CollectionChanged event since my parent is not databound there should be only the intentional firings from my children. Any suggestions ??? _____________________________________________ The world is a dangerous place.
    Not because of those that do evil,
        but because of those who look on and do nothing.

    A 1 Reply Last reply
    0
    • L LongRange Shooter

      Hokay Dokay.... I have an MDIParent with a controller window on the side. The controller window creates the instances of the MDIChild forms and defines the MDIParent as the parent of the children. So far so good. All works just dandy -- including managing multiple instances, etc. Now -- the next enhancement to the app. I need to do processing on the children AFTER they have been created. What I want to do is this: Delegate an event in my parent form to do the after-creation process. Have my children raise the event once the form has been loaded. The question is this: Is there a GOOD existing event I can use to accomplish this that guarantees me that only the children raising the event will trigger the event, or should I define my own event to handle it? I want to make sure that normal window process does not fire this event since what I have to do is rather intense processing! I was thinking of reusing the CollectionChanged event since my parent is not databound there should be only the intentional firings from my children. Any suggestions ??? _____________________________________________ The world is a dangerous place.
      Not because of those that do evil,
          but because of those who look on and do nothing.

      A Offline
      A Offline
      Atul Kale
      wrote on last edited by
      #2

      Hi there, There u got one more Problem in the Forms library :laugh:. Microsoft has provided enough of Collections almost everywhere possible, but they forgot to make the MDIChildren as a Collection. Unfortunately it is an Array!
      So, CollectionChanged etc. is not helpful at all! You have to go for creating your own events for managing the Pre and Post creation processing of ur Child forms.
      However, i would like to mention one thing that, default event processing would be synchronous. You may look at using Application.DoEvents method or use a new Thread for performing the processing to make it asyynchronous. hope this helps! :) Atul Kale Sr. Software Engineer XcelVision Technologies Ltd.

      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