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. Accessing MDI child controls under MDI application

Accessing MDI child controls under MDI application

Scheduled Pinned Locked Moved C#
questionworkspace
4 Posts 3 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
    sinosoidal
    wrote on last edited by
    #1

    Hi, I want to build a MDI application. The workspace of my application (MDI child) has some controls inside of it. In the mean while i want to be able to controls such components in my main application code. How can i do it if they arent instantiated? Thx, Nuno

    O P 2 Replies Last reply
    0
    • S sinosoidal

      Hi, I want to build a MDI application. The workspace of my application (MDI child) has some controls inside of it. In the mean while i want to be able to controls such components in my main application code. How can i do it if they arent instantiated? Thx, Nuno

      O Offline
      O Offline
      Obaid ur Rehman
      wrote on last edited by
      #2

      I don't think it would be a good idea to Access Form controls from outside the form. One of the approach you can take is define public functions in the child forms and call these from the MDI Parent.

      S 1 Reply Last reply
      0
      • O Obaid ur Rehman

        I don't think it would be a good idea to Access Form controls from outside the form. One of the approach you can take is define public functions in the child forms and call these from the MDI Parent.

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

        Ok. Thx!

        1 Reply Last reply
        0
        • S sinosoidal

          Hi, I want to build a MDI application. The workspace of my application (MDI child) has some controls inside of it. In the mean while i want to be able to controls such components in my main application code. How can i do it if they arent instantiated? Thx, Nuno

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Can I suggest that you take a look at design patterns - specifically the MVC pattern. Have a read up on it, and see why this is not a good idea. More importantly, a good text on the MVC pattern will show you how to solve this issue in a better fashion. You don't want to couple up the logic in a main form so that it knows how to update/control the controls in a child form. That is the responsibility of the child form. All you need to do is tell the child form WHAT you want it to achieve, and let it work out how to do it.

          Deja View - the feeling that you've seen this post before.

          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