'-- Return the dimensions of your monitor.
Size = System.ReturnScreenSizeInches
Height = Size.GetY
Width = Size. GetX
MsgBox.Info("Height ="++Height.AsString+NL+"Width ="
If the numbers seem wrong, the monitor may be out of calibration. See the ArcView Help topic 'Calibrating your monitor' for more information.
'-- Query the current monitor for its size
thisScreenHeight = System.ReturnScreenSizeInches.GetY
thisScreenWidth = System.ReturnScreenSizeInches.GetX
'-- Find the difference between this screen
'-- and the screen you built the project on.
resizeFactorY = thisScreenHeight / origScreenHeight
resizeFactorX = thisScreenWidth / origScreenWidth
'-- Get the View, and find its current size
theView = av.GetProject.FindDoc("Your View")
viewWinHeight = theView.GetWin.ReturnExtent.GetY
viewWinWidth = theView.GetWin.ReturnExtent.GetX
'-- Resize the View DocWin so it is proportional
'-- to the size of this new monitor.
newViewWinHeight = viewWinHeight * resizeFactorY
newViewWinWidth = viewWinWidth * resizeFactorX
When this project is opened the script will automatically adjust for any monitor size change.
Get help from ArcGIS experts
Download the Esri Support App