?
Solved

dynamically scroll/change size of a dialog

Posted on 2004-11-22
3
Medium Priority
?
491 Views
Last Modified: 2013-11-20
I have some edit controls I've added at run-time to a modal dialog.

Since I don't know how many I'm going to need prior to run-time, I need a way to either resize the dialog or allow it to be scrolled.

I've tried using the following code (in my class based on the CDialog class) to re-size the HEIGHT of the dialog:

this->GetWindowRect(&rect2);
SetWindowPos(&wndTop, rect2.left, rect2.top, rect2.right, rect2.bottom + y,SWP_NOZORDER | SWP_SHOWWINDOW );

This doesn't work right though... it keeps expanding the WIDTH of the dialog. If I use GetClientRect, it doesn't work either. Then the WIDTH is shrinking.

What am I missing?
0
Comment
Question by:JoyBurke
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
AaronReams earned 500 total points
ID: 12649791
     CRect rect2;
      this->GetWindowRect(&rect2);
      SetWindowPos(&wndTop, rect2.left, rect2.top, rect2.Width(), rect2.Height()+50,SWP_NOZORDER | SWP_SHOWWINDOW );
0
 
LVL 8

Expert Comment

by:AaronReams
ID: 12649846
As you can probably infer from my example, you need to specify the height (bottom - top) you want the window to be rather then the location of the bottom coordinate.

Cheers,
Aaron
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question