Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Resizing a dialog based on user input

Posted on 2004-08-15
2
Medium Priority
?
186 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 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month10 days, 13 hours left to enroll

885 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