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. Multiple UI threads in a single application

Multiple UI threads in a single application

Scheduled Pinned Locked Moved C#
winformscomdesignsysadmin
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.
  • N Offline
    N Offline
    Neil Lamka
    wrote on last edited by
    #1

    I have an application that consists of a main windows form and a 2nd thread that handles communications back to a server. Based on a command stream from the server the main thread starts other windows forms that share an event/notification message structure. Since each of the newly created windows forms totally control the UI and handle messages related to the tool passed through the event system I wanted to run each on an independent UI thread instead of having all windows running off of the single main UI thread. In playing around with this I have not found any examples and have been unsuccesful at trying to figure out a structure that would do what I'm trying to accomplish. Any suggestions or pointers. Thanks Neil Lamka neil@meetingworks.com

    S 1 Reply Last reply
    0
    • N Neil Lamka

      I have an application that consists of a main windows form and a 2nd thread that handles communications back to a server. Based on a command stream from the server the main thread starts other windows forms that share an event/notification message structure. Since each of the newly created windows forms totally control the UI and handle messages related to the tool passed through the event system I wanted to run each on an independent UI thread instead of having all windows running off of the single main UI thread. In playing around with this I have not found any examples and have been unsuccesful at trying to figure out a structure that would do what I'm trying to accomplish. Any suggestions or pointers. Thanks Neil Lamka neil@meetingworks.com

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

      This will do the trick

      void UIThread()
      {
      Form yourForm = new Form();
      Application.Run(yourForm);
      }
      }

      Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      N 1 Reply Last reply
      0
      • S S Senthil Kumar

        This will do the trick

        void UIThread()
        {
        Form yourForm = new Form();
        Application.Run(yourForm);
        }
        }

        Regards Senthil _____________________________ My Blog | My Articles | WinMacro

        N Offline
        N Offline
        Neil Lamka
        wrote on last edited by
        #3

        Thanks much, I'll give that a try. Neil Lamka neil@meetingworks.com

        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