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. How to set the border width of dialog box

How to set the border width of dialog box

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
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.
  • G Offline
    G Offline
    Ganesh_T
    wrote on last edited by
    #1

    I have ceated a dialog box whose bporder width seems to be thick around 2 pixel. How can I increase/decrease the boreder width of dialog box Any kind of help is appreciated. Cheers

    "A winner is not one who never fails...but the one who never quits"

    N 1 Reply Last reply
    0
    • G Ganesh_T

      I have ceated a dialog box whose bporder width seems to be thick around 2 pixel. How can I increase/decrease the boreder width of dialog box Any kind of help is appreciated. Cheers

      "A winner is not one who never fails...but the one who never quits"

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      You need to increase non client area size for this purpose handle WM_NCCALCSIZE, add a message map entry for ON_WM_NCCALCSIZE()... A sample implementation looks likewise...

      void CDialogTestDlg::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp)
      {
      UNREFERENCED_PARAMETER( bCalcValidRects ); // Read the docs on this variable

      // Increase border width by 4!
      lpncsp->rgrc->top += 4;
      lpncsp->rgrc->left += 4;
      lpncsp->rgrc->bottom -= 4;
      lpncsp->rgrc->right -= 4;
      CWnd::OnNcCalcSize( bCalcValidRects, lpncsp );
      }

      Also note that you may need to handle WM_NCPAINT to fill out increased region.

      Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

      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