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. Place Form windows at certain position in MDI Application

Place Form windows at certain position in MDI Application

Scheduled Pinned Locked Moved C#
csharp
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.
  • H Offline
    H Offline
    hardsoft
    wrote on last edited by
    #1

    I want to place a MDI form at a certain position in relation to the MDI background application window. Ie. When I display a certain form I would like to display the form on the right of the applications MDI window and locatthis child form in the top right corner. How could I achieve this in c#.

    P 1 Reply Last reply
    0
    • H hardsoft

      I want to place a MDI form at a certain position in relation to the MDI background application window. Ie. When I display a certain form I would like to display the form on the right of the applications MDI window and locatthis child form in the top right corner. How could I achieve this in c#.

      P Offline
      P Offline
      paas
      wrote on last edited by
      #2

      In the Activate or Shown Event of the child form you could probably include code like the following:

      this.Location = new Point(this.ParentForm.Width - (this.Width + 10), 0);

      Of course, if you put the code in the Activate event you will want to ensure the code only executes the first time the form activates. That should get your MDI child in the ballpark of the right corner of the parent form. You might have to play around with the value you add to this.Width a little bit. Good luck.

      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