Solved

How to make the controls fit to Scrren?

Posted on 2008-06-13
3
317 Views
Last Modified: 2013-11-20
Question:
I have developed a Simple Dialog Based Application in that dialog i have two controls(OK and cancel),when i try to maximum the dialog into full screen the controls are not fitting to the screen coordinates.The position of the controls is same as when the dialog was minimizes.How can i make to fit to screen?
0
Comment
Question by:Rajeshm8484
  • 2
3 Comments
 
LVL 45

Expert Comment

by:Kdo
ID: 21778020
Hi Rajeshm8484,

Create an OnResize() event handler for the Dialog.

Within the handler, set the desired position of the controls.

When the window maximizes or returns to normal, or when it's resized by dragging a corner/edge the handler will be executed allowing you to move the controls as appropriate.


Good Luck,
Kent
0
 

Author Comment

by:Rajeshm8484
ID: 21778104
How can i get the exact position of controls where to place,when i maximize or minimize?
0
 

Accepted Solution

by:
Rajeshm8484 earned 0 total points
ID: 21836131
In the attached file list,Interface.txt is the Interface file(i.e.h extension file) and Implementation.txt is the  Implementation file (i.e .cpp extension file) for SizingDialog class.SizingDailog class is derived from CDialog..The dialog in which the controls have to be fitted to screen when maximized or minimized , derive that dialog class from SizingDialog(i.e replace ur Dialog class from SizingDialog everywhere)...In the InitInstance() function of ur dialog call

//////////////For Resizing
       this->AddResizaleCtrl(NULL);

       this->SendMessage(WM_SIZE);

Thanks and Regards,
Rajes.M
Implementation.txt
Interface.txt
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

911 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

23 Experts available now in Live!

Get 1:1 Help Now