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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. limiting the size of a CDialog

limiting the size of a CDialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 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
    nss
    wrote on last edited by
    #1

    I have a Cdialog with a CListCtrl in it that sizes along with the CDialog(MoveWindow). Theres text in the list, plus scrollbars. Whne the user lengthens the CDialog, the scrollbars eventaully vanish. AT this point I want the window to not be able to lengthen any further. How do I find out when the scrollbars have disappeared. I didnt see anything like BOOL ScrollBARsExist() or something like it in MSDN...maybe I need to get the height of the text in the cListctrl but how do I figure out that? Also theres no OnGEtMinMAxInfo for a CDialog...so what tells it to have a max limit?

    S M 2 Replies Last reply
    0
    • N nss

      I have a Cdialog with a CListCtrl in it that sizes along with the CDialog(MoveWindow). Theres text in the list, plus scrollbars. Whne the user lengthens the CDialog, the scrollbars eventaully vanish. AT this point I want the window to not be able to lengthen any further. How do I find out when the scrollbars have disappeared. I didnt see anything like BOOL ScrollBARsExist() or something like it in MSDN...maybe I need to get the height of the text in the cListctrl but how do I figure out that? Also theres no OnGEtMinMAxInfo for a CDialog...so what tells it to have a max limit?

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      override ::OnSizing(...) (don't forget to add the ON_WM_SIZING() handler in your message map).

      N 1 Reply Last reply
      0
      • S Stephane Rodriguez

        override ::OnSizing(...) (don't forget to add the ON_WM_SIZING() handler in your message map).

        N Offline
        N Offline
        nss
        wrote on last edited by
        #3

        Thanks! Any hints about detecting the vanishing of the clistctrl scrollbars?

        S 1 Reply Last reply
        0
        • N nss

          Thanks! Any hints about detecting the vanishing of the clistctrl scrollbars?

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          compare GetScrollPos() and GetScrollLimit().

          1 Reply Last reply
          0
          • N nss

            I have a Cdialog with a CListCtrl in it that sizes along with the CDialog(MoveWindow). Theres text in the list, plus scrollbars. Whne the user lengthens the CDialog, the scrollbars eventaully vanish. AT this point I want the window to not be able to lengthen any further. How do I find out when the scrollbars have disappeared. I didnt see anything like BOOL ScrollBARsExist() or something like it in MSDN...maybe I need to get the height of the text in the cListctrl but how do I figure out that? Also theres no OnGEtMinMAxInfo for a CDialog...so what tells it to have a max limit?

            M Offline
            M Offline
            Michael Dunn
            wrote on last edited by
            #5

            WM_GETMINMAXINFO certainly works for dialogs, although it might not appear in the ClassWizard so you'll need to add the message map entries yourself. --Mike-- The Internet is a place where absolutely nothing happens.   -- Strong Bad 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

            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