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