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 / C++ / MFC
  4. OnSize method

OnSize method

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • F Offline
    F Offline
    Florin Ochiana
    wrote on last edited by
    #1

    Hi, I have a dialog in which I overloaded the OnSize method. I want to make my dialog to have some minimum dimensions so that the user couldn't resize the dialog past these dimensions. I've tried something like this but the dialog can be resized: MyDialog::OnSize (UINT nType, int cx, int cy) { if (cx < MyCx || cy < MyCy) // if the new cx is smaller than the minimum // MyCx there should be no resizing return; // normal resizing procedures... } Any ideas? Thanks. ----- We are what we repeatedly do. Excellence, then, is not an act, but a habit.

    M 1 Reply Last reply
    0
    • F Florin Ochiana

      Hi, I have a dialog in which I overloaded the OnSize method. I want to make my dialog to have some minimum dimensions so that the user couldn't resize the dialog past these dimensions. I've tried something like this but the dialog can be resized: MyDialog::OnSize (UINT nType, int cx, int cy) { if (cx < MyCx || cy < MyCy) // if the new cx is smaller than the minimum // MyCx there should be no resizing return; // normal resizing procedures... } Any ideas? Thanks. ----- We are what we repeatedly do. Excellence, then, is not an act, but a habit.

      M Offline
      M Offline
      Martyn Pearson
      wrote on last edited by
      #2

      Check out WM_GETMINMAXINFO - handling this message lets you set the minimum and maximum sizes of the dialog. Note that to get the message to appear in ClassWizard, you need to go to the Class Info tab, and set the Message Filter to "Window"

      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