Solved

Resizing a dialog based on user input

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now