阅读:3853回复:0
在form_resize的时候防止map刷新的方法
Software: MapObjects LT 1.0, 2.0 MapObjects-Windows 1.2, 2.0, 2.0a
Platforms: Windows 95, 98, NT 3.51, NT 4.0, 2000 有两种方法控制地图不刷新: 1. 使用WinAPI 来设置DRAGFULLWINDOWS 系统属性无效 2. 在form-resize的时候使地图不见 过程: 把下面的vb代码加到一个工程里,必须包括一个 Map control 和一个 Timer. Option Explicit Dim liLastWidth As Long Dim liLastHeight As Long ' For Windows API fix, uncomment these lines: 'Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long 'Private Const SPI_SETDRAGFULLWINDOWS = 37 Private Sub Form_Load() ' For Windows API fix, uncomment the following line. 'SystemParametersInfo SPI_SETDRAGFULLWINDOWS, 0, Null, 0 liLastWidth = Map1.Width liLastHeight = Map1.Height Timer1.Interval = 10 End Sub Private Sub Form_Resize() If Map1.Visible Then Map1.Visible = False Timer1.Enabled = True End If Map1.Width = Form1.Width - 300 Map1.Height = Form1.Height - 800 End Sub Private Sub Timer1_Timer() If Map1.Width = liLastWidth And Map1.Height = liLastHeight Then Map1.Visible = True Timer1.Enabled = False Else liLastWidth = Map1.Width liLastHeight = Map1.Height End If End Sub |
|
|