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

📄 frmmain.frm

📁 师兄做的一个利用VB结合mapx组件做的超市查询小系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form frmMain 
   Caption         =   "西安市超市查询信息系统"
   ClientHeight    =   8040
   ClientLeft      =   165
   ClientTop       =   555
   ClientWidth     =   10575
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   8040
   ScaleWidth      =   10575
   StartUpPosition =   2  '屏幕中心
   WindowState     =   2  'Maximized
   Begin VB.ListBox lstName 
      Height          =   3120
      Left            =   9000
      TabIndex        =   4
      Top             =   3000
      Width           =   1455
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   5760
      Top             =   7080
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   21
      ImageHeight     =   19
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   15
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":27A2
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":2CB6
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":31CA
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":36DE
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":3BF2
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":4106
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":4618
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":4B2C
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":503E
            Key             =   ""
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":5552
            Key             =   ""
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":5A66
            Key             =   ""
         EndProperty
         BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":5F7A
            Key             =   ""
         EndProperty
         BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":648E
            Key             =   ""
         EndProperty
         BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":69A2
            Key             =   ""
         EndProperty
         BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":6EB6
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.ListBox lstLayers 
      Height          =   2040
      Left            =   9120
      TabIndex        =   3
      Top             =   480
      Width           =   1455
   End
   Begin MSComctlLib.StatusBar MapStatusBar 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   2
      Top             =   7665
      Width           =   10575
      _ExtentX        =   18653
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   4
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   6
            TextSave        =   "2006-9-14"
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            TextSave        =   "15:31"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar barMain 
      Align           =   1  'Align Top
      Height          =   465
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Width           =   10575
      _ExtentX        =   18653
      _ExtentY        =   820
      ButtonWidth     =   741
      ButtonHeight    =   661
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   17
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   1
            Style           =   2
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   2
            Style           =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   3
            Style           =   2
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   4
            Style           =   2
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   5
            Style           =   2
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   6
            Style           =   2
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   7
            Style           =   2
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   12
            Style           =   2
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   13
            Style           =   2
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   8
            Style           =   2
         EndProperty
         BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   9
            Style           =   2
         EndProperty
         BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   10
            Style           =   2
         EndProperty
         BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   11
            Style           =   2
         EndProperty
         BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   14
            Style           =   2
         EndProperty
         BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   15
            Style           =   2
         EndProperty
      EndProperty
   End
   Begin MSComDlg.CommonDialog cdlTest 
      Left            =   7200
      Top             =   480
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.PictureBox MapDisp 
      Height          =   6015
      Left            =   480
      ScaleHeight     =   5955
      ScaleWidth      =   8235
      TabIndex        =   0
      Top             =   960
      Width           =   8295
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件"
      Begin VB.Menu mnuLayerControl 
         Caption         =   "图层控制"
      End
      Begin VB.Menu mnuExportMap 
         Caption         =   "地图输出"
      End
      Begin VB.Menu mnuPrinter 
         Caption         =   "地图打印"
      End
      Begin VB.Menu mnuExit 
         Caption         =   "退出"
      End
   End
   Begin VB.Menu mnuTool 
      Caption         =   "工具"
      Begin VB.Menu mnuZoomIn 
         Caption         =   "放大"
      End
      Begin VB.Menu mnuZoomOut 
         Caption         =   "缩小"
      End
      Begin VB.Menu mnuPan 
         Caption         =   "漫游"
      End
      Begin VB.Menu mnuFullView 
         Caption         =   "全图"
      End
      Begin VB.Menu mnuDistance 
         Caption         =   "距离"
      End
      Begin VB.Menu mnutab1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuSelectPoint 
         Caption         =   "单点选择"
      End
      Begin VB.Menu mnuCirSelect 
         Caption         =   "圆形选择"
      End
      Begin VB.Menu mnuRectSelect 
         Caption         =   "矩形选择"
      End
      Begin VB.Menu mnuPolySelect 
         Caption         =   "区域选择"
      End
      Begin VB.Menu mnutab2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuLabel 
         Caption         =   "标注"
      End
      Begin VB.Menu mnuSymbol 
         Caption         =   "符号"
      End
      Begin VB.Menu mnuText 
         Caption         =   "文本"
      End
   End
   Begin VB.Menu mnuSearch 
      Caption         =   "查询"
      Begin VB.Menu mnuSearchI 
         Caption         =   "I查询"
      End
      Begin VB.Menu mnuSQLSearch 
         Caption         =   "SQL查询"
      End
      Begin VB.Menu mnuAttribute 
         Caption         =   "属性数据"
      End
      Begin VB.Menu mnuTheme1 
         Caption         =   "专题地图"
         Begin VB.Menu mnuTheme 
            Caption         =   "制作专题地图"
         End
         Begin VB.Menu mnuEditTheme 
            Caption         =   "修改专题地图"
         End
         Begin VB.Menu mnuEditLegend 
            Caption         =   "修改图例"
         End
         Begin VB.Menu mnuDelTheme 
            Caption         =   "删除专题地图"
         End
      End
   End
   Begin VB.Menu mnuSpatial 
      Caption         =   "空间分析"
      Begin VB.Menu mnuBuffer 
         Caption         =   "缓冲区"
      End
      Begin VB.Menu mnuLengthORArea 
         Caption         =   "长度/面积、周长"
      End
      Begin VB.Menu mnuDisSearch 
         Caption         =   "距离查询"
      End
      Begin VB.Menu mnuLocationSearch 
         Caption         =   "位置查询"
      End
   End
   Begin VB.Menu mnuShortestPath 
      Caption         =   "最短路径"
      Begin VB.Menu mnuStartPoint 
         Caption         =   "选择起点"
      End
      Begin VB.Menu mnuEndPoint 
         Caption         =   "选择终点"
         Enabled         =   0   'False
      End
      Begin VB.Menu mnuReadData 
         Caption         =   "读入数据"
      End
      Begin VB.Menu mnuSearchShortPath 
         Caption         =   "最短路径"
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "帮助"
      Begin VB.Menu mnuEdtion 
         Caption         =   "关于"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

Const TOOL_DISTANCE_ID = 500


Dim XDown As Double
Dim YDown As Double
Dim m_bSelect As Boolean
Dim StartID As Integer
Dim EndID As Integer
Dim ClickCount As Integer
Dim iStartID As Integer, iEndID As Integer
Dim Fs_Short As MapXLib.Features
Dim ShortCount As Integer
Dim fs_Color As OLE_COLOR
Dim NameFindIndex As Integer
Dim FoundObj As MapXLib.Feature

Dim NoNode() As Integer, nNode As Integer, LineNode() As Integer, LineDis() As Double
Dim nLineNode As Integer, LinkN() As Integer, LinkNi() As Integer
Dim LinkDis() As Double, LinkNo() As Integer, nNodeShortPath As Integer
Dim NodeShortPath() As Integer, ShortPath As Double
Dim XNode() As Double, YNode() As Double


Public m_Layer As Layer
Public DataSet As MapXLib.DataSet



Private Sub barMain_ButtonClick(ByVal Button As MSComctlLib.Button)
  Select Case Button.Index
    Case 1: mnuLayerControl_Click
    Case 2: mnuPrinter_Click
    Case 3:
    Case 4: mnuZoomIn_Click
    Case 5: mnuZoomOut_Click
    Case 6: mnuPan_Click
    Case 7: mnuFullView_Click
    Case 8: mnuDistance_Click
    Case 9: mnuLabel_Click
    Case 10: mnuText_Click
    Case 11:
    Case 12: mnuSelectPoint_Click
    Case 13: mnuCirSelect_Click
    Case 14: mnuRectSelect_Click
    Case 15: mnuPolySelect_Click
    Case 16: mnuSearchI_Click
    Case 17: mnuAttribute_Click
  End Select
End Sub

Private Sub Form_Load()
  Dim sFile As String
  Dim i As Integer
  
  sFile = App.Path + "\data\"
  MapDisp.GeoSet = sFile + "XA.gst"
  MapDisp.Title.Visible = False
  
  MapDisp.Top = barMain.Height
  MapDisp.Left = 0
  CoordSys.Set 8, 28, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0
  
 ' CoordSys.Set miNonEarth, , 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, MapDisp.Layers.Bounds
  MapDisp.NumericCoordSys = CoordSys

  
  For i = 1 To Me.MapDisp.Layers.Count
    Set m_Layer = MapDisp.Layers(i)
    Set DataSet = MapDisp.DataSets.Add(miDataSetLayer, m_Layer, m_Layer.Name)
    lstLayers.AddItem m_Layer.Name
  Next i
  lstLayers.ListIndex = 0
  
  MapDisp.Layers("商场、超市").AutoLabel = True
  For i = 1 To MapDisp.DataSets("商场、超市").RowCount
      lstName.AddItem MapDisp.DataSets("商场、超市").Value(i, 1)
  Next i
  
  Call CreateDistance

  m_bSelect = False
  ClickCount = 0
  ShortCount = 0
  

  Oldwinproc = GetWindowLong(MapDisp.hWnd, GWL_WNDPROC)
  SetWindowLong MapDisp.hWnd, GWL_WNDPROC, AddressOf FlexScroll
End Sub

Private Sub Form_Resize()
  Me.MapDisp.Height = Me.ScaleHeight
  Me.MapDisp.Width = Me.ScaleWidth * 0.86
  
  lstLayers.Left = Me.Width * 0.85
  lstLayers.Width = Me.Width * 0.15
  lstLayers.Top = Me.barMain.Height
  lstLayers.Height = Me.Height * 0.2
  
  lstName.Left = Me.Width * 0.85
  lstName.Width = Me.Width * 0.15
  lstName.Top = Me.barMain.Height + Me.ScaleHeight * 0.24
  lstName.Height = Me.ScaleHeight * 0.66
  
  Me.MapStatusBar.Panels(1).Width = Me.ScaleWidth / 2
  Me.MapStatusBar.Panels(2).Width = Me.ScaleWidth * 3 / 10
  Me.MapStatusBar.Panels(3).Width = Me.ScaleWidth / 10
  Me.MapStatusBar.Panels(4).Width = Me.ScaleWidth / 10
  

⌨️ 快捷键说明

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