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

📄 frmstatisticcom.frm

📁 都是基于VB所做的程序集合,值得大家作为实践的参考资料.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmStatisticCom 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "栅格常规统计分析(等于、大于、小于)"
   ClientHeight    =   4290
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5370
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4290
   ScaleWidth      =   5370
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   435
      Left            =   4380
      TabIndex        =   18
      Top             =   3780
      Width           =   945
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定"
      Height          =   435
      Left            =   3270
      TabIndex        =   17
      Top             =   3765
      Width           =   945
   End
   Begin VB.Frame Frame2 
      Caption         =   "参加比较的数据"
      Height          =   1425
      Left            =   1950
      TabIndex        =   10
      Top             =   1095
      Width           =   3390
      Begin VB.ComboBox cmbPro 
         Height          =   315
         ItemData        =   "frmStatisticCom.frx":0000
         Left            =   1095
         List            =   "frmStatisticCom.frx":000D
         Style           =   2  'Dropdown List
         TabIndex        =   16
         Top             =   1035
         Width           =   2100
      End
      Begin VB.ComboBox cmbDtList2 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   12
         Top             =   645
         Width           =   2100
      End
      Begin VB.ComboBox cmbDsList2 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   11
         Top             =   255
         Width           =   2100
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "分析功能:"
         Height          =   195
         Index           =   4
         Left            =   160
         TabIndex        =   15
         Top             =   1050
         Width           =   900
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据集:"
         Height          =   195
         Index           =   2
         Left            =   340
         TabIndex        =   14
         Top             =   690
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据源:"
         Height          =   195
         Index           =   3
         Left            =   340
         TabIndex        =   13
         Top             =   330
         Width           =   720
      End
   End
   Begin VB.Frame Frame4 
      Caption         =   "结果数据集保存"
      Height          =   1140
      Left            =   1950
      TabIndex        =   5
      Top             =   2550
      Width           =   3390
      Begin VB.ComboBox cmbDsListResult 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   7
         Top             =   285
         Width           =   2070
      End
      Begin VB.TextBox txtDataset 
         Height          =   315
         Left            =   1095
         TabIndex        =   6
         Text            =   "Raster"
         Top             =   660
         Width           =   2070
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据源:"
         Height          =   195
         Index           =   6
         Left            =   340
         TabIndex        =   9
         Top             =   330
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据集:"
         Height          =   195
         Index           =   7
         Left            =   340
         TabIndex        =   8
         Top             =   705
         Width           =   720
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "参加分析的数据"
      Height          =   1065
      Left            =   1950
      TabIndex        =   0
      Top             =   0
      Width           =   3390
      Begin VB.ComboBox cmbDsList1 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   255
         Width           =   2100
      End
      Begin VB.ComboBox cmbDtList1 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   1
         Top             =   645
         Width           =   2100
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据源:"
         Height          =   195
         Index           =   0
         Left            =   340
         TabIndex        =   4
         Top             =   330
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据集:"
         Height          =   195
         Index           =   1
         Left            =   345
         TabIndex        =   3
         Top             =   645
         Width           =   720
      End
   End
   Begin VB.Image Image1 
      BorderStyle     =   1  'Fixed Single
      Height          =   4260
      Left            =   30
      Picture         =   "frmStatisticCom.frx":0023
      Stretch         =   -1  'True
      Top             =   0
      Width           =   1890
   End
End
Attribute VB_Name = "frmStatisticCom"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmbDsList1_Click()
    If cmbDsList1.Text = "" Then Exit Sub
    If frmMain.bActiveFrm Then
        ChangeDs cmbDsList1.Text, cmbDtList1
    End If
End Sub

Private Sub cmbDsList2_Click()
    If cmbDsList2.Text = "" Then Exit Sub
    If frmMain.bActiveFrm Then
        ChangeDs cmbDsList2.Text, cmbDtList2
    End If
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOk_Click()
    Dim objDs As soDataSource
    Dim objDtRst As soDatasetRaster
    Dim objDtLocal As soDatasetRaster
    Dim objGridAnalystEx As soGridAnalystEx
    Dim objStatisticOperator As soStatisticOperator
    Dim strTmp As String
    
    Set objDs = frmMain.SuperWorkspace.Datasources(cmbDsList1.Text)
    Set objDtRst = objDs.Datasets(cmbDtList1.Text)
    Set objDs = frmMain.SuperWorkspace.Datasources(cmbDsList2.Text)
    Set objDtLocal = objDs.Datasets(cmbDtList2.Text)
    Set objDs = frmMain.SuperWorkspace.Datasources(cmbDsListResult.Text)
    strTmp = DataSetName(objDs, txtDataset.Text)
    If strTmp <> "" Then
        Set objGridAnalystEx = frmMain.SuperAnalyst.GridAnalyst
        Set objStatisticOperator = objGridAnalystEx.Statistics
        Select Case cmbPro.ListIndex
            Case 0 '等于
                Set objDtRst = objStatisticOperator.EqualTo(objDtRst, objDtLocal, objDs, strTmp)
                strTmp = "等于"
            Case 1 '大于
                Set objDtRst = objStatisticOperator.GreaterThan(objDtRst, objDtLocal, objDs, strTmp)
                strTmp = "大于"
            Case 2 '小于
                Set objDtRst = objStatisticOperator.LessThan(objDtRst, objDtLocal, objDs, strTmp)
                strTmp = "小于"
        End Select
        If Not objDtRst Is Nothing Then
            frmMain.SuperWkspManager.Refresh
        Else
            
            MsgBox "常规统计(" & strTmp & ")分析失败", vbInformation, "信息提示"
        End If
        Set objDtLocal = Nothing
        Set objDtRst = Nothing
        Set objDs = Nothing
        Set objGridAnalystEx = Nothing
        Set objStatisticOperator = Nothing
        Unload Me
    Else
        txtDataset.Text = ""
        txtDataset.SetFocus
    End If
    
    Set objDtLocal = Nothing
    Set objDtRst = Nothing
    Set objDs = Nothing
    Set objGridAnalystEx = Nothing
    Set objStatisticOperator = Nothing
End Sub

Private Sub Form_Activate()
    frmMain.bActiveFrm = True
    cmbDsList1_Click
    cmbDsList2_Click
End Sub

Private Sub Form_Load()
    cmbPro.ListIndex = 0
End Sub

⌨️ 快捷键说明

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