Solved

Resizing a dialog based on user input

Posted on 2004-08-15
2
172 Views
Last Modified: 2013-11-20
What i am wanting to do is to have a dialog window that is not resizable by the user, however the user can enter a number and the height of the window will be adjusted based on that.

e.g. the default for the dialog is 120 high, however if a variable is changed to hold the value 10, then the dialog will adjust to 120 + (x * 10) high

Basically, is there a system call that will allow me to adjust the size of the dialog in the code, without giving the user the option of resizing the window manually.

I am working in VC++ 6.0 on windows 2000 system, but the code needs to be useable on all windows operating systems from 98 up.

Thanks
  Ryan
0
Comment
Question by:Psyco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
Nass89 earned 125 total points
ID: 11806992
Hi,
Tthe following codes do that. In your codes, take the height from an EditBox.

      int Height;
                 CRect cr;
               Heigth=50;
      GetWindowRect(&cr);
      cr.bottom+=Height;
      MoveWindow(cr,TRUE);

Good Luck!
0
 

Author Comment

by:Psyco
ID: 11807017
Apart from
    Heigth=50;
needing to be
    Height=50;   (typo on the ht)

That code works perfectly.

This is exactly what I was looking for.


0

Featured Post

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 56
Detect CR LF to each line 12 185
move a line in eclipse 3 111
no14 challenge 14 78
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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