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. resizing a dialog

resizing a dialog

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 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.
  • K Offline
    K Offline
    Krauze
    wrote on last edited by
    #1

    I'm coding with VC++ 2008 and I've got a dialog with none border. Now I wanna resize it in some other message handlers, such as BTN_CLICKED, than CDialog::InitDialog(), using CWnd::MoveWindow(). But it won't work. So anyone could help? Many thanks in advance.

    L M 2 Replies Last reply
    0
    • K Krauze

      I'm coding with VC++ 2008 and I've got a dialog with none border. Now I wanna resize it in some other message handlers, such as BTN_CLICKED, than CDialog::InitDialog(), using CWnd::MoveWindow(). But it won't work. So anyone could help? Many thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Krauze wrote:

      But it won't work.

      What won't work? Unless you show the code that you are using and explain what you expect to happen and what actually happens, we cannot begin to guess what might be the problem.

      Just say 'NO' to evaluated arguments for diadic functions! Ash

      1 Reply Last reply
      0
      • K Krauze

        I'm coding with VC++ 2008 and I've got a dialog with none border. Now I wanna resize it in some other message handlers, such as BTN_CLICKED, than CDialog::InitDialog(), using CWnd::MoveWindow(). But it won't work. So anyone could help? Many thanks in advance.

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        resize : you mean dynamically ? or only when the dialog is created ? if dynamically, then, Windows User Experience Guidelines says that you need a border to be able to "grab" to something to resize the dialog, and that's only for resizing the dialog frame, not moving and repositioning the content which you will have to do manually. If you really need to have no border for your dialog, then you need something to "anchor" the mouse position and handle the mouse movements to compute the new dialog frame size. for example (in pseudo-code ) : in the handler for LBUTTON_DOWN for the dialog , get and store the mouse position (A) and capture it (Get/SetCapture) in the handler for LButtON_UP, get the current mouse position (B); compute the difference between A anb B and resize the dialog (SetWindowPos) with the computed diffference. ... good luck with that.

        Watched code never compiles.

        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