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. Resizing Forms as per Screen Resolution

Resizing Forms as per Screen Resolution

Scheduled Pinned Locked Moved C#
csharphelpdesignquestion
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.
  • S Offline
    S Offline
    Sanket Patil
    wrote on last edited by
    #1

    Hi to all, I have a problem regarding form resizing. I am devloping a window application using C#.NET. I am using an MDI Form to open other Forms. I have set padding property of that MDI Form. The problem I have is, whenever I am Changing the screen resolution My form does not resize. Please help me to solve my problem. How can I resize my window Form dynamically as per the screen resolution changes or is there any solution so that eventhough the screen resolution changes My form design should not change -- Thanks & Regard Sanket Patil.

    .

    0 1 Reply Last reply
    0
    • S Sanket Patil

      Hi to all, I have a problem regarding form resizing. I am devloping a window application using C#.NET. I am using an MDI Form to open other Forms. I have set padding property of that MDI Form. The problem I have is, whenever I am Changing the screen resolution My form does not resize. Please help me to solve my problem. How can I resize my window Form dynamically as per the screen resolution changes or is there any solution so that eventhough the screen resolution changes My form design should not change -- Thanks & Regard Sanket Patil.

      .

      0 Offline
      0 Offline
      0x3c0
      wrote on last edited by
      #2

      Catch the Microsoft.Win32.SystemEvents.DisplaySettingsChanged and DisplaySettingsChanging events. When you receive the DisplaySettingsChanging event, make a note of the then-current resolution. When you receive the DisplaySettingsChanged event, get the current resolution. You now have the two needed resolutions; if they're equal, you don't need to do anything. If they aren't, then the Form's width is [PreviousWidth * (previousResolution.Width / currentResolution.Width)] and the height applies the same formula, but with heights instead of width

      Between the idea And the reality Between the motion And the act Falls the Shadow

      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