zhjhp
路人甲
路人甲
  • 注册日期2004-02-22
  • 发帖数62
  • QQ
  • 铜币296枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1707回复:1

斑竹,请看看这个MO的例子,

楼主#
更多 发布于:2004-06-29 17:00
<P>为什么达不到程序里要求选择的shape闪烁3次呢,我用的是美国states文件</P>
<P>比如,在text1中输入vermont的州名,在map中把选中的范围闪烁3次</P>
<P>Private Sub Text1_KeyPress(KeyAscii As Integer)
  If KeyAscii = vbKeyReturn Then
    Dim recs As MapObjects2.Recordset
    Dim shp As Object
    Dim rect As MapObjects2.Rectangle
    Dim exp As String
    
    ‘ build a search expression
    exp = “STATE_NAME = ‘“ ; Text1.Text ; “‘“
    ‘ perform the search
    Set recs = Map1.Layers(“States”). _
    SearchExpression(exp)
    ‘ show the results, if any
    If Not recs.EOF Then
      Set shp = recs.Fields(“Shape”).Value
      Set rect = shp.Extent
      rect.ScaleRectangle 2
      Set Map1.Extent = rect  ‘ zoom to state
      Map1.Refresh   ‘ force redraw of the map
      Map1.FlashShape shp, 3  ‘ flash the state
    End If
  End If
End Sub</P>
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2004-06-30 00:50
你可以看看帮助里有例子了,在mo帮助里查FlashShape
举报 回复(0) 喜欢(0)     评分
游客

返回顶部