Solved

Resizing a dialog based on user input

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

18 Experts available now in Live!

Get 1:1 Help Now