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. WPF
  4. Windows Form z-order?

Windows Form z-order?

Scheduled Pinned Locked Moved WPF
helpquestion
4 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.
  • C Offline
    C Offline
    Cyrilix
    wrote on last edited by
    #1

    I am essentially running an application that creates a thread to run a Form, say Form1 by calling...

    Application.Run(new Form1()); //new thread has already been created and this is run on that new thread

    Then, the application runs another process. This creates a Form, say Form2 in the same way that Form1 was created, by calling Application.Run(). The problem is that Form1 is on top of Form2, even though right before the Application.Run() call of Form2, I call BringToFront(), which is supposed to place it at the front of the z-order. Why is Form1 on top of Form2 even though Form2 was created afterwards, and explicitly brought to the front? I would like to do this without having to call SendToBack() on Form1, since I don't want to send it all the way back, I just want it to be behind Form2.

    P 1 Reply Last reply
    0
    • C Cyrilix

      I am essentially running an application that creates a thread to run a Form, say Form1 by calling...

      Application.Run(new Form1()); //new thread has already been created and this is run on that new thread

      Then, the application runs another process. This creates a Form, say Form2 in the same way that Form1 was created, by calling Application.Run(). The problem is that Form1 is on top of Form2, even though right before the Application.Run() call of Form2, I call BringToFront(), which is supposed to place it at the front of the z-order. Why is Form1 on top of Form2 even though Form2 was created afterwards, and explicitly brought to the front? I would like to do this without having to call SendToBack() on Form1, since I don't want to send it all the way back, I just want it to be behind Form2.

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

      Wrong forum. This is for WPF, WCF and WF - not Windows Forms.

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      My blog | My articles | MoXAML PowerToys

      C 1 Reply Last reply
      0
      • P Pete OHanlon

        Wrong forum. This is for WPF, WCF and WF - not Windows Forms.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        My blog | My articles | MoXAML PowerToys

        C Offline
        C Offline
        Cyrilix
        wrote on last edited by
        #3

        Woops, I thought WF == Windows Forms. I'll re-post in that forum then. Thanks.

        P 1 Reply Last reply
        0
        • C Cyrilix

          Woops, I thought WF == Windows Forms. I'll re-post in that forum then. Thanks.

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

          No problems - and an easy mistake to make.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          My blog | My articles | MoXAML PowerToys

          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