2

I have a dialog based application which contain controls such treectrl,listsctrl and group box contain all the buttons control. I am working in Visual Studio 2010 Professional Edition.All controls are placed in the Dialog at design time and no control is created at run time.

Using

int desktopW = GetSystemMetrics(SM_CXVIRTUALSCREEN); 
int desktopH = GetSystemMetrics(SM_CYVIRTUALSCREEN);

got the width and height of window, then found the relative position of the controls.

Using SetWindowPos try to change the width and height of various control, if new width and height is less than old control width and height.

But that involves a lot of calculation.

Is there exist any easy way to change the control position/scaling based on window size?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
VickyCool
  • 113
  • 1
  • 12

1 Answers1

0

Use Dynamic Layout for the controls.

See the Properties of each control. Then by using the Moving Type and Sizing Type properties you can specify how the control must move and/or resize as the dialog frame resizes.

dynamic-layout-properties

acraig5075
  • 10,588
  • 3
  • 31
  • 50