Solved

Resizing a dialog based on user input

Posted on 2004-08-15
2
170 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

Independent Software Vendors: 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
Separate into files by filename 12 91
modThree challenge 4 105
Making an alias 7 113
x-bar in Google Sheets 2 93
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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