PROBLEM
Code:
'-- Return the dimensions of your monitor.
Size = System.ReturnScreenSizeInches
Height = Size.GetY
Width = Size. GetX
MsgBox.Info("Height ="++Height.AsString+NL+"Width ="
++width.AsString,"Screen Size")
Note:
If the numbers seem wrong, the monitor may be out of calibration. See the ArcView Help topic 'Calibrating your monitor' for more information.
Code:
'-- 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
theView.GetWin.Resize(newViewWinWidth, newViewWinHeight)
Note:
When this project is opened the script will automatically adjust for any monitor size change.
Article ID:000001565
Get help from ArcGIS experts
Download the Esri Support App