if Ttag <= 5 then
if Ttag mod 2 then
Map1.SelectionStyle.RegionBackColor = RGB(255, 0, 0)
else
Map1.SelectionStyle.RegionBackColor = RGB(0,255, 0)
end if
Ttag =Ttag +1
end if
在timer1_time事件里添加以下代码
将timer1的触发周期设为500(半秒)
static T as long
if T > 1 then
T =0
Map1.SelectionStyle.RegionBackColor = RGB(255, 0, 0)
else
T = T +1
Map1.SelectionStyle.RegionBackColor = RGB(0, 255, 0)
end if
'设置interval=1000
Private Sub Timer1_Timer()
If i = 0 Then
Map1.SelectionStyle.RegionBackColor = RGB(255, 0, 0)
i = 1
Exit Sub
End If
If i = 1 Then
Map1.SelectionStyle.RegionBackColor = RGB(0, 255, 0)i = 0
Exit Sub
End If
if Ttag <= 5 then
if Ttag mod 2 then
Map1.SelectionStyle.RegionBackColor = RGB(255, 0, 0)
else
Map1.SelectionStyle.RegionBackColor = RGB(0,255, 0)
end if
Ttag =Ttag +1
else
Ttag =1
Timer1.enabled = False
end if