Solved

How to make the controls fit to Scrren?

Posted on 2008-06-13
3
320 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: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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
NotAlone Challenge 20 84
firstChar challenge 13 120
c++ reading data from file into two dimensional array 3 117
Gaming Software 1 19
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

840 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