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

📄 form2.frm

📁 采用VB和MO二次开发的全国经济地理信息系统 内含开发全过程的详细文档
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{C7FC2F7C-0688-11D5-B2F8-000102D87123}#1.0#0"; "MO21Legend.ocx"
Object = "{6C20C089-0689-11D5-B2F8-000102D87123}#2.0#0"; "MO21ScaleBar.ocx"
Begin VB.Form Formmain 
   Caption         =   "全国经济地理信息系统"
   ClientHeight    =   8550
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   12720
   Icon            =   "Form2.frx":0000
   LinkTopic       =   "Form2"
   ScaleHeight     =   8550
   ScaleWidth      =   12720
   StartUpPosition =   3  '窗口缺省
   WindowState     =   2  'Maximized
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   360
      Left            =   0
      TabIndex        =   5
      Top             =   8190
      Width           =   12720
      _ExtentX        =   22437
      _ExtentY        =   635
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   2912
            MinWidth        =   2912
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3529
            MinWidth        =   3529
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   7938
            MinWidth        =   7938
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   8820
            MinWidth        =   8820
         EndProperty
      EndProperty
   End
   Begin MO21ScaleBar.ScaleBar sbScaleBar1 
      Height          =   495
      Left            =   120
      TabIndex        =   4
      Top             =   6600
      Width           =   2415
      _ExtentX        =   4260
      _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
   End
   Begin MapObjects2.Map Map2 
      Height          =   2895
      Left            =   120
      TabIndex        =   3
      Top             =   7320
      Width           =   2415
      _Version        =   131072
      _ExtentX        =   4260
      _ExtentY        =   5106
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "Form2.frx":030A
   End
   Begin MO21legend.legend legend1 
      Height          =   5895
      Left            =   120
      TabIndex        =   2
      Top             =   480
      Width           =   2415
      _ExtentX        =   4260
      _ExtentY        =   10398
      BackColor       =   -2147483626
      ForeColor       =   -2147483630
      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
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   2760
      Top             =   6360
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   3120
      Top             =   5640
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   10
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":0324
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":0436
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":3E91
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":4705
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":4F77
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":57E9
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":58FB
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":5A0D
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":5B1F
            Key             =   ""
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":5C31
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   420
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Width           =   12720
      _ExtentX        =   22437
      _ExtentY        =   741
      ButtonWidth     =   609
      ButtonHeight    =   582
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   10
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "打开"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "保存"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "打印"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "放大"
            ImageIndex      =   4
            Style           =   2
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "缩小"
            ImageIndex      =   5
            Style           =   2
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "移动"
            ImageIndex      =   6
            Style           =   2
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "全图显示"
            ImageIndex      =   7
            Style           =   2
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "测量"
            ImageIndex      =   8
            Style           =   2
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "框选"
            ImageIndex      =   9
            Style           =   2
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Object.ToolTipText     =   "文本"
            ImageIndex      =   10
            Style           =   2
         EndProperty
      EndProperty
   End
   Begin MapObjects2.Map Map1 
      Height          =   9855
      Left            =   2640
      TabIndex        =   0
      Top             =   480
      Width           =   12615
      _Version        =   131072
      _ExtentX        =   22251
      _ExtentY        =   17383
      _StockProps     =   225
      BackColor       =   16777215
      BorderStyle     =   1
      Contents        =   "Form2.frx":61DD
   End
   Begin VB.Menu pup1 
      Caption         =   "图层打开"
      Begin VB.Menu open 
         Caption         =   "打开"
      End
      Begin VB.Menu save 
         Caption         =   "保存"
      End
      Begin VB.Menu end 
         Caption         =   "退出"
      End
      Begin VB.Menu print 
         Caption         =   "打印"
      End
      Begin VB.Menu alldelete 
         Caption         =   "清空"
      End
      Begin VB.Menu delete 
         Caption         =   "图层删除"
      End
   End
   Begin VB.Menu chuli 
      Caption         =   "图形操作"
      Begin VB.Menu zoomin 
         Caption         =   "放大"
      End
      Begin VB.Menu zoomout 
         Caption         =   "缩小"
      End
      Begin VB.Menu pan 
         Caption         =   "移动"
      End
      Begin VB.Menu show 
         Caption         =   "全图显示"
      End
      Begin VB.Menu liangce 
         Caption         =   "测量"
      End
   End
   Begin VB.Menu paint 
      Caption         =   "图形绘制"
      Begin VB.Menu point 
         Caption         =   "画点"
      End
      Begin VB.Menu line 
         Caption         =   "画线"
      End
      Begin VB.Menu rectangle 
         Caption         =   "矩形"
      End
      Begin VB.Menu cirle 
         Caption         =   "圆"
      End
      Begin VB.Menu poly 
         Caption         =   "多边形"
      End
      Begin VB.Menu text 
         Caption         =   "写文本"
      End
      Begin VB.Menu texing 
         Caption         =   "图形特性"
      End
   End
   Begin VB.Menu xianran 
      Caption         =   "图层渲染"
      Begin VB.Menu biaozhu 
         Caption         =   "标注"
      End
      Begin VB.Menu color 
         Caption         =   "渲染色彩"
      End
      Begin VB.Menu fold 
         Caption         =   "设置标注字体"
      End
      Begin VB.Menu Re 
         Caption         =   "经济数据渲染.."
      End
      Begin VB.Menu closeR 
         Caption         =   "关闭渲染"
      End
   End
   Begin VB.Menu quiry 
      Caption         =   "查询"
      Begin VB.Menu SearchEc 
         Caption         =   "经济数据查询"
      End
      Begin VB.Menu susea 
         Caption         =   "属性数据查询..."
      End
      Begin VB.Menu length 
         Caption         =   "线段长度"
      End
      Begin VB.Menu area 
         Caption         =   "区域面积"
      End
   End
   Begin VB.Menu set 
      Caption         =   "设置"
      Begin VB.Menu Status 
         Caption         =   "状态栏"
      End
      Begin VB.Menu toobar 
         Caption         =   "工具栏"
      End
   End
   Begin VB.Menu help 
      Caption         =   "帮助"
      Begin VB.Menu doo 
         Caption         =   "操作"
      End
      Begin VB.Menu about 
         Caption         =   "关于..."
      End
   End
End
Attribute VB_Name = "Formmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim t As Integer
Dim a As Integer
Dim i As Integer
Dim h As Integer
Dim g_feedback As DragFeedback
Dim TextSym As New MapObjects2.TextSymbol
Dim P1 As MapObjects2.point
Dim sym As New MapObjects2.Symbol
Dim pt As MapObjects2.point
Dim g_Line As MapObjects2.line
Dim Pts As MapObjects2.Points
Dim Recs As MapObjects2.Recordset
Dim Shp As Object
Dim moline1 As MapObjects2.line
Dim SeaEC As Boolean                                     '经济数据的查询状态
Dim hh As Boolean
Dim color3 As Single
Dim na, si, bo, it, un, co As Single                 ' 设置标注字体参数
Dim fo As Boolean                      '标注时是否默认状态

Private Sub about_Click()
        Load Frmabout
        Frmabout.show
End Sub

Private Sub biaozhu_Click() '点标注
 Dim layer As MapLayer
 Set layer = Map1.Layers(a)
 Set layer.Renderer = New LabelRenderer
 If fo = False Then
  With layer.Renderer
   .Field = "NAME"
   .Symbol(0).color = moBlack
   .Symbol(0).Font.Size = 8
  End With
 End If
 If fo = True Then
 With layer.Renderer
    .Field = "NAME"
    .Symbol(0).Font.Name = na
    .Symbol(0).Font.Size = si
    .Symbol(0).Font.Bold = bo
    .Symbol(0).Font.Italic = it
    .Symbol(0).Font.Underline = un
    .Symbol(0).color = co
  End With
  End If
 Map1.Refresh
End Sub

Private Sub closeR_Click()
         Set Map1.Layers(a).Renderer = Nothing
        Map1.Refresh
End Sub

Private Sub doo_Click()
        MsgBox "要删除图层,编辑图层,查询区域面积、线段长度时,一定要先单击当前图层"
End Sub

Private Sub fold_Click()                          ' 设置标注字体
 fo = True
 CommonDialog1.Flags = cdlCFBoth Or cdlCFEffects
 CommonDialog1.Action = 4
 na = CommonDialog1.FontName
 si = CommonDialog1.FontSize
 bo = CommonDialog1.FontBold
 it = CommonDialog1.FontItalic
 un = CommonDialog1.FontUnderline
 co = CommonDialog1.color
End Sub

Private Sub color_Click()                         '渲染色彩
 CommonDialog1.Action = 3
 color3 = CommonDialog1.color
End Sub


Private Sub end_Click()   '退出
 End
End Sub
                             
Private Sub alldelete_Click()    '清空
 Map1.Layers.Clear
 Map1.Refresh
End Sub
Private Sub delete_Click()        '图层删除
 If t = 1 Then
  Map1.Layers.Remove a
  Map2.Layers.Remove a
  Map1.Refresh
  Map2.Refresh
 End If
End Sub

Private Sub Form_Load()
        DrawLayer
        Dim ly As MapObjects2.MapLayer
        Set ly = Map1.Layers("省界prj")
        Set ly.Renderer = New LabelRenderer
        With ly.Renderer
            .Field = "NAME"
            .Symbol(0).color = moBlack
            .Symbol(0).Font.Size = 8
        End With
        SeaEC = False
        
End Sub

Private Sub legend1_MouseDown(index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
 If Button = 1 Then
    t = 1
    a = index          'a记录当前编辑图层
 End If
 Map1.Refresh
 Map2.Refresh
End Sub



Private Sub open_Click()   '打开
Dim strFileTitle As String, sDataSetName As String
  Dim sFileDirectory As String
  Dim dc As New MapObjects2.DataConnection
  Dim layer As New MapObjects2.MapLayer
  
  CommonDialog1.Filter = "Shapefiles (*.shp)|*.shp"
  CommonDialog1.ShowOpen
  
  strFileTitle = CommonDialog1.FileTitle

⌨️ 快捷键说明

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