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. Paren/Child in different threads?

Paren/Child in different threads?

Scheduled Pinned Locked Moved C#
c++tutorialquestion
5 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.
  • A Offline
    A Offline
    Alex_Y
    wrote on last edited by
    #1

    Is it possible to make parent and child forms running in the different threads. For example parent form will be in main app thread which launch another thread which creates form and are child to the parent from. Actaualy what I want to achieve to have MDI in which views/child forms running in the own thread. In C++ was 100 methods to it using WinAPI/MFC/ATL/Stingray ... Here I confused to find at least single way to do it. :)

    S 1 Reply Last reply
    0
    • A Alex_Y

      Is it possible to make parent and child forms running in the different threads. For example parent form will be in main app thread which launch another thread which creates form and are child to the parent from. Actaualy what I want to achieve to have MDI in which views/child forms running in the own thread. In C++ was 100 methods to it using WinAPI/MFC/ATL/Stingray ... Here I confused to find at least single way to do it. :)

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      Sure you can, launch the other thread and call Application.Run from the other thread.

      void buttonClick(...)
      {
      new Thread(new ThreadStart(NewThread)).Start();
      }

      void NewThread()
      {
      Application.Run(new ChildForm());
      }

      Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      A 1 Reply Last reply
      0
      • S S Senthil Kumar

        Sure you can, launch the other thread and call Application.Run from the other thread.

        void buttonClick(...)
        {
        new Thread(new ThreadStart(NewThread)).Start();
        }

        void NewThread()
        {
        Application.Run(new ChildForm());
        }

        Regards Senthil _____________________________ My Blog | My Articles | WinMacro

        A Offline
        A Offline
        Alex_Y
        wrote on last edited by
        #3

        Could you please explain what is ChildForm. Where it declared (namespace) or it custom with some flags which makes it child. Thanks. :)

        S 1 Reply Last reply
        0
        • A Alex_Y

          Could you please explain what is ChildForm. Where it declared (namespace) or it custom with some flags which makes it child. Thanks. :)

          S Offline
          S Offline
          S Senthil Kumar
          wrote on last edited by
          #4

          Alex_Y wrote:

          Could you please explain what is ChildForm.

          Nothing special, it's the type name for the form which you want to be displayed in a separate thread. Just replace it your form's class name. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

          A 1 Reply Last reply
          0
          • S S Senthil Kumar

            Alex_Y wrote:

            Could you please explain what is ChildForm.

            Nothing special, it's the type name for the form which you want to be displayed in a separate thread. Just replace it your form's class name. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

            A Offline
            A Offline
            Alex_Y
            wrote on last edited by
            #5

            This is the thing. When you trying to set ChildForm to be child of parent or set parent to ChildForm either way it showing differnt errors. Parent/child relation error or sync issues. :)

            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