How to resize control when screen resolution changed?
-
A single document project, view class inheritance from CFromView. In view from, have many controls, edit control, static control... When screen resolution changed or project runing from 16 by 10 screen to 4 by 3 screen, controls not printed right what printed right in 16 by 10 screen. I can use GetSystemMetrics(SM_CXFULLSCREEN) and GetSystemMetrics(SM_CYFULLSCREEN) to get screen resolution and then make controls size to fix to current screen,but controls are to many in from. I want to make all controls by simple way.
-
A single document project, view class inheritance from CFromView. In view from, have many controls, edit control, static control... When screen resolution changed or project runing from 16 by 10 screen to 4 by 3 screen, controls not printed right what printed right in 16 by 10 screen. I can use GetSystemMetrics(SM_CXFULLSCREEN) and GetSystemMetrics(SM_CYFULLSCREEN) to get screen resolution and then make controls size to fix to current screen,but controls are to many in from. I want to make all controls by simple way.
double xRatio = GetSystemMetrics(SM_CXSCREEN) / 800.00; double yRatio = GetSystemMetrics(SM_CYSCREEN) / 600.00; rect.left = long((rect.left/1.28)*xRatio); rect.top = long((rect.top/1.28)*yRatio); rect.bottom = long((rect.bottom/1.28)*yRatio); rect.right = long((rect.right/1.28)*xRatio);
Nigah M Manzoor