阅读:1864回复:1
斑竹,请看看这个MO的例子,
<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> |
|
1楼#
发布于:2004-06-30 00:50
你可以看看帮助里有例子了,在mo帮助里查FlashShape
|
|
|