⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_main.frm

📁 vb+mo而次开发实现鹰眼功能
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Object = "{6C20C089-0689-11D5-B2F8-000102D87123}#2.0#0"; "MO21ScaleBar.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form frm_main 
   Caption         =   "GIS_SYSTEM"
   ClientHeight    =   7710
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   11550
   Icon            =   "frm_main.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   7710
   ScaleWidth      =   11550
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   200
      Left            =   7680
      Top             =   1200
   End
   Begin MO21ScaleBar.ScaleBar sclBar1 
      Height          =   495
      Left            =   2280
      TabIndex        =   3
      Top             =   6720
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   873
      BackColor       =   -2147483633
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      MapUnits        =   2
      ScaleBarUnits   =   2
      ScreenUnits     =   1
   End
   Begin MSComctlLib.StatusBar stusBar1 
      Align           =   2  'Align Bottom
      Height          =   405
      Left            =   0
      TabIndex        =   2
      Top             =   7305
      Width           =   11550
      _ExtentX        =   20373
      _ExtentY        =   714
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   4
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "比例显示"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "X坐标"
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "Y坐标"
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   12171
            Object.ToolTipText     =   "^-^"
         EndProperty
      EndProperty
   End
   Begin MapObjects2.Map Map1 
      DragIcon        =   "frm_main.frx":0442
      Height          =   6975
      Left            =   0
      TabIndex        =   1
      Top             =   360
      Width           =   11535
      _Version        =   131072
      _ExtentX        =   20346
      _ExtentY        =   12303
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "frm_main.frx":0884
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   5640
      Top             =   0
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DefaultExt      =   "*.shp"
      DialogTitle     =   "打开 Shape 文件"
      Filter          =   "Shape File(*.shp)|*.shp"
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   4920
      Top             =   -120
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   9
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":089E
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":0CF0
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":1142
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":1254
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":1366
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":1478
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":158A
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":19DC
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frm_main.frx":1AEE
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   420
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   11550
      _ExtentX        =   20373
      _ExtentY        =   741
      ButtonWidth     =   609
      ButtonHeight    =   582
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   12
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   1
            Style           =   1
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   2
            Style           =   1
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   3
            Style           =   2
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   4
            Style           =   2
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   5
            Style           =   2
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   6
            Style           =   2
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   7
            Style           =   1
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   9
            Style           =   1
         EndProperty
      EndProperty
   End
   Begin VB.Menu file 
      Caption         =   "文件(&F)"
      Begin VB.Menu new 
         Caption         =   "新建"
         Shortcut        =   ^N
      End
      Begin VB.Menu open 
         Caption         =   "打开"
         Shortcut        =   ^O
      End
   End
   Begin VB.Menu gra_see 
      Caption         =   "视图(&V)"
      Begin VB.Menu Allsee 
         Caption         =   "鸟瞰图"
      End
   End
   Begin VB.Menu query_main 
      Caption         =   "查询(&Q)"
      Begin VB.Menu query_point 
         Caption         =   "点查询"
      End
      Begin VB.Menu query_sql 
         Caption         =   "SQL查询"
      End
   End
   Begin VB.Menu menu_tool 
      Caption         =   "工具(&T)"
      Begin VB.Menu tool_big 
         Caption         =   "放大"
      End
      Begin VB.Menu tool_small 
         Caption         =   "缩小"
      End
      Begin VB.Menu tool_pan 
         Caption         =   "平移"
      End
      Begin VB.Menu tool_globle 
         Caption         =   "全局"
      End
      Begin VB.Menu tool_omit 
         Caption         =   "-"
      End
      Begin VB.Menu tool_lyr_show 
         Caption         =   "图层控制"
      End
   End
   Begin VB.Menu menu_help 
      Caption         =   "帮助(&H)"
      Begin VB.Menu help_about 
         Caption         =   "关于......"
      End
      Begin VB.Menu omit1 
         Caption         =   "-"
      End
      Begin VB.Menu help_tell 
         Caption         =   "文档说明"
      End
   End
End
Attribute VB_Name = "frm_main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Public lyr As MapLayer
Dim zbX1, zbX2, zbY1, zbY2 As Integer
Dim Xmid, Ymid As Long



Sub refreshScale()
If Map1.Layers.Count <> 0 Then

sclBar1.MapExtent.MaxX = Map1.Extent.Right
sclBar1.MapExtent.MinX = Map1.Extent.Left
sclBar1.MapExtent.MaxY = Map1.Extent.Bottom
sclBar1.MapExtent.MinY = Map1.Extent.Top

sclBar1.PageExtent.MinX = Map1.Left / Screen.TwipsPerPixelX
sclBar1.PageExtent.MinY = Map1.Top / Screen.TwipsPerPixelY
sclBar1.PageExtent.MaxX = (Map1.Left + Map1.Width) / Screen.TwipsPerPixelX
sclBar1.PageExtent.MaxY = (Map1.Top + Map1.Height) / Screen.TwipsPerPixelX

sclBar1.Refresh

stusBar1.Panels(1).Text = "比例:   1:" & Format$(sclBar1.RFScale, "###,###,###,###")

End If

End Sub


Private Sub help_tell_Click()
gg = 111

 
Dim sql_Expression As String

sql_Expression = "CODE='MX06'"


Set recSelection = Map1.Layers(0).SearchExpression(sql_Expression)
Set sym_Selection = New MapObjects2.Symbol

sym_Selection.SymbolType = Map1.Layers(0).Symbol.SymbolType
sym_Selection.Color = moDarkGreen



End Sub

Sub ZoomIn()
Dim rec As MapObjects2.Rectangle
Set rec = Map1.Extent
rec.ScaleRectangle 0.5
Map1.Extent = rec

End Sub

Sub ZoomOut()

Dim rec As MapObjects2.Rectangle

Set rec = Map1.Extent
rec.ScaleRectangle 1.5
Map1.Extent = rec
End Sub

Sub ZoomPan()
Map1.Pan

End Sub

Sub Globle()
Map1.Extent = Map1.FullExtent

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -