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

📄 frmviewequipmentinfo.frm

📁 用VB开发的巡检系统基于MAPINFo用VB开发的巡检系统基于MAPINFo很好的
💻 FRM
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "Vsflex7.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmViewEquipmentInfo 
   Caption         =   "浏览属性表"
   ClientHeight    =   6435
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9720
   Icon            =   "frmViewEquipmentInfo.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   6435
   ScaleWidth      =   9720
   StartUpPosition =   2  '屏幕中心
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Command1 
      Caption         =   "地图定位(&M)"
      Height          =   375
      Left            =   6600
      TabIndex        =   4
      Top             =   5670
      Width           =   1185
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出(&E)"
      Height          =   375
      Left            =   7830
      TabIndex        =   3
      Top             =   5670
      Width           =   1185
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   315
      Left            =   0
      TabIndex        =   2
      Top             =   6120
      Width           =   9720
      _ExtentX        =   17145
      _ExtentY        =   556
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   3
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Bevel           =   0
            Object.Width           =   882
            MinWidth        =   882
            Text            =   "表名"
            TextSave        =   "表名"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   5292
            MinWidth        =   5292
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   10398
         EndProperty
      EndProperty
   End
   Begin VSFlex7Ctl.VSFlexGrid VSFlexGrid1 
      Height          =   5445
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   9735
      _cx             =   17171
      _cy             =   9604
      _ConvInfo       =   1
      Appearance      =   1
      BorderStyle     =   1
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      MousePointer    =   0
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      BackColorFixed  =   -2147483633
      ForeColorFixed  =   -2147483630
      BackColorSel    =   -2147483635
      ForeColorSel    =   -2147483634
      BackColorBkg    =   -2147483636
      BackColorAlternate=   -2147483643
      GridColor       =   -2147483633
      GridColorFixed  =   -2147483632
      TreeColor       =   -2147483632
      FloodColor      =   192
      SheetBorder     =   -2147483642
      FocusRect       =   1
      HighLight       =   1
      AllowSelection  =   -1  'True
      AllowBigSelection=   -1  'True
      AllowUserResizing=   0
      SelectionMode   =   0
      GridLines       =   1
      GridLinesFixed  =   2
      GridLineWidth   =   1
      Rows            =   2
      Cols            =   3
      FixedRows       =   1
      FixedCols       =   1
      RowHeightMin    =   0
      RowHeightMax    =   0
      ColWidthMin     =   0
      ColWidthMax     =   0
      ExtendLastCol   =   0   'False
      FormatString    =   ""
      ScrollTrack     =   0   'False
      ScrollBars      =   3
      ScrollTips      =   0   'False
      MergeCells      =   0
      MergeCompare    =   0
      AutoResize      =   -1  'True
      AutoSizeMode    =   0
      AutoSearch      =   0
      AutoSearchDelay =   2
      MultiTotals     =   -1  'True
      SubtotalPosition=   1
      OutlineBar      =   0
      OutlineCol      =   0
      Ellipsis        =   0
      ExplorerBar     =   0
      PicturesOver    =   0   'False
      FillStyle       =   0
      RightToLeft     =   0   'False
      PictureType     =   0
      TabBehavior     =   0
      OwnerDraw       =   0
      Editable        =   0
      ShowComboButton =   -1  'True
      WordWrap        =   0   'False
      TextStyle       =   0
      TextStyleFixed  =   0
      OleDragMode     =   0
      OleDropMode     =   0
      DataMode        =   0
      VirtualData     =   -1  'True
      DataMember      =   ""
      ComboSearch     =   3
      AutoSizeMouse   =   -1  'True
      FrozenRows      =   0
      FrozenCols      =   0
      AllowUserFreezing=   0
      BackColorFrozen =   0
      ForeColorFrozen =   0
      WallPaperAlignment=   9
   End
   Begin VB.Label Label1 
      BorderStyle     =   1  'Fixed Single
      Height          =   45
      Left            =   0
      TabIndex        =   1
      Top             =   5550
      Width           =   9675
   End
End
Attribute VB_Name = "frmViewEquipmentInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
    '地图定位
    Dim TableName As String
    Dim RowID As Integer
    Me.WindowState = 1
    TableName = Me.StatusBar1.Panels(2).Text
    RowID = Me.VSFlexGrid1.RowSel
    If Len(TableName) = 0 Then Exit Sub
    If SearchLocalName(MapInfo, TableName, RowID) = True Then
        '表示定位到符合的地块
    End If
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub


Private Sub Form_Resize()
    On Error Resume Next
    With Me
        .VSFlexGrid1.Top = 0
        .VSFlexGrid1.Left = 0
        
        .Command2.Top = .ScaleHeight - .StatusBar1.Height - 500
        .Command1.Top = .Command2.Top
        .Command2.Left = .ScaleWidth - 1500
        .Command1.Left = .Command2.Left - .Command1.Width - 100
        
        .Label1.Top = .Command2.Top - 100
        .Label1.Width = .ScaleWidth
        
        .VSFlexGrid1.Height = .Command2.Top - 200
        .VSFlexGrid1.Width = .ScaleWidth
        
    End With
End Sub

'读取表的信息
Public Sub ReadTableInfo()
    'Exit Sub
    Dim TableName As String, iCols As Integer, iRows As Integer, i As Integer, J As Integer
    Dim RecNum As Long
    
    TableName = Me.StatusBar1.Panels(2).Text
    '获取表的字段数
    iCols = Val(MapInfo.Eval("TableInfo(" & TableName & "," & TAB_INFO_NCOLS & ")"))
    iRows = Val(MapInfo.Eval("TableInfo(" & TableName & "," & TAB_INFO_NROWS & ")"))
    
    With Me.VSFlexGrid1
        .Cols = iCols + 1
        .Rows = iRows + 1
        '表字段
        .TextMatrix(0, 0) = "序号"
        .ColWidth(0) = 800
        .ColAlignment(0) = flexAlignCenterCenter
        
'        .TextMatrix(0, 1) = "标识码"
'        .ColWidth(1) = 1200
'        .ColAlignment(1) = flexAlignCenterCenter
        
        For i = 1 To iCols
            .ColWidth(i) = 2000
            .ColAlignment(i) = flexAlignCenterCenter
            .TextMatrix(0, i) = MapInfo.Eval("ColumnInfo(""" & TableName & """,""col" & i & """,1)")
        Next
        
        '定位该对象在表中记录位置
        MapInfo.Do "Fetch First From " & TableName
        '表记录数
        For J = 1 To iRows
            '序号
            .TextMatrix(J, 0) = J
            '表字段值
            For i = 1 To iCols
                .TextMatrix(J, i) = MapInfo.Eval(TableName & ".Col" & i)
            Next
            MapInfo.Do "Fetch Next From " & TableName
        Next
    End With
    
End Sub

⌨️ 快捷键说明

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