Solved

How to make the controls fit to Scrren?

Posted on 2008-06-13
3
322 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
[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
3 Comments
 
LVL 45

Expert Comment

by:Kent Olsen
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

Industry Leaders: 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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

730 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