Page 1 of 1

How To Check Whether Dialog Size Is Bigger Than Screen Size

PostPosted: Tue Jul 03, 2012 9:24 am
by acwoo1
Hi

How to check whether a user has selected a dialog box bigger than the monitor screen size.

Regards
ACWoo

Re: How To Check Whether Dialog Size Is Bigger Than Screen Size

PostPosted: Tue Jul 03, 2012 9:59 am
by Marc Vanzegbroeck
Hi,

You can check the dialog-size with oDlg:nWidth and oDlg:nheight
The screen-dimensions can be retreived by the getsysmetrics() function.

Regads,
Marc

Re: How To Check Whether Dialog Size Is Bigger Than Screen Size

PostPosted: Tue Jul 03, 2012 10:23 am
by Bayron
It may be something like:

Code: Select all  Expand view
If oDlg:nWidth > WndWidth( GetDesktopWindow() ) .or. oDlg:nHeight > WndHeight( GetDesktopWindow() )

Re: How To Check Whether Dialog Size Is Bigger Than Screen Size

PostPosted: Tue Jul 03, 2012 10:50 am
by ukoenig
For the dialog-size, You need a small adjustment ( Dialog-style ),
because the frame is not included in oDlg:nWidth and oDlg:nHeight => :

Testing with sreen 1024 x 768
Dialog with title and border Dialog = Screensize

DEFINE DIALOG oDlg2 FROM 0, 0 TO 768 -28, 1024 -8 PIXEL

ACTIVATE DIALOG oDlg2 ;
ON INIT ( Msgalert( GetSysmetrics( 0 ), "Screen-width (1024)"), ;
Msgalert( GetSysmetrics( 1 ), "Screen-height (768)"), ;
Msgalert( oDlg2:nWidth, "Dialog-width"), ;
Msgalert( oDlg2:nHeight, "Dialog-height") )


Best Regards
Uwe :lol:

Re: How To Check Whether Dialog Size Is Bigger Than Screen Size

PostPosted: Tue Jul 03, 2012 2:40 pm
by acwoo1
Hi

Thanks a lot

Regards

ACWoo