Re: Adjusting to screen resolutions
Override the dialog's OnInitDialog() function.
BOOL CMyDialog::OnInitDialog()
{
int nScreenWidth = ::GetSystemMetrics( CM_CXSCREEN ); // Supported by
WinCE
int nScreenHeight = ::GetSystemMetrics( CM_CYSCREEN ); // Supported by
WinCE
MoveWindow( 0, 0, nScreenWidth, nScreenHeight, TRUE );
return TRUE;
}
Override the OnSize() function.
void CMyDialog::OnSize( UINT nType, int cx, int cy )
{
// Calculate the child controls' positions and call MoveWindow on each of
them.
}
As for .Net, yes, there is an automatic way to position and resize controls
on a form. You can set "Anchor" properties for controls in the design mode
and not worry about coding to re-position/size controls. You still need to
resize the main form programmatically to fit to the screen.
"Chris H" <humme.chris@royalmaster.com> wrote in message
news:OKkC3n8oHHA.3892@TK2MSFTNGP04.phx.gbl...
I am looking for the best way to have a dialog based program scale up and
down to fully file the screen for several different screen resolutions.
I need to have the buttons stretch or compress so that the same number of
buttons show in generally the same relative proportions.
Since this is an embedded application I could set some flags and compile a
different version depending on the targeted display, if I have to. I would
like to avoid having multiple versions of the project to maintain.
By the way would .net offer any help for this?
Thanks