frminputfloodinfo.frm
来自「FloodEvaluation-程序是gis方面的程序」· FRM 代码 · 共 365 行
FRM
365 行
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmInputFloodInfo
Caption = "请输入本次洪水信息"
ClientHeight = 7020
ClientLeft = 60
ClientTop = 345
ClientWidth = 7260
Icon = "frmInputFloodInfo.frx":0000
LinkTopic = "Form1"
ScaleHeight = 7020
ScaleWidth = 7260
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdAdd
Caption = "添 加"
Height = 375
Left = 3840
TabIndex = 25
Top = 6480
Width = 855
End
Begin VB.Frame Frame1
Height = 2775
Left = 120
TabIndex = 1
Top = 3480
Width = 6975
Begin VB.CommandButton cmdLossSde
Caption = "指定"
Height = 375
Left = 6000
TabIndex = 23
Top = 2160
Width = 615
End
Begin VB.CommandButton cmdCropSde
Caption = "指定"
Height = 375
Left = 2400
TabIndex = 22
Top = 2160
Width = 615
End
Begin VB.CommandButton cmdAreaSde
Caption = "指定"
Height = 375
Left = 6000
TabIndex = 21
Top = 1560
Width = 615
End
Begin VB.CommandButton cmdPopuSde
Caption = "指定"
Height = 375
Left = 2400
TabIndex = 20
Top = 1560
Width = 615
End
Begin VB.CommandButton cmdDepth
Caption = "指定"
Height = 375
Left = 6000
TabIndex = 19
Top = 960
Width = 615
End
Begin VB.CommandButton cmdRange
Caption = "指定"
Height = 375
Left = 2400
TabIndex = 18
Top = 960
Width = 615
End
Begin VB.TextBox txtName
Height = 375
Left = 1080
TabIndex = 9
Top = 360
Width = 1575
End
Begin VB.TextBox txtDate
Height = 375
Left = 4680
TabIndex = 8
Top = 360
Width = 1575
End
Begin VB.TextBox txtRangeSde
Height = 375
Left = 1080
TabIndex = 7
Top = 960
Width = 1335
End
Begin VB.TextBox txtDepthSde
Height = 375
Left = 4680
TabIndex = 6
Top = 960
Width = 1335
End
Begin VB.TextBox txtPopuSde
Height = 375
Left = 1080
TabIndex = 5
Top = 1560
Width = 1335
End
Begin VB.TextBox txtAreaSde
Height = 375
Left = 4680
TabIndex = 4
Top = 1560
Width = 1335
End
Begin VB.TextBox txtCropLossSde
Height = 375
Left = 1080
TabIndex = 3
Top = 2160
Width = 1335
End
Begin VB.TextBox txtTotalLossSde
Height = 375
Left = 4680
TabIndex = 2
Top = 2160
Width = 1335
End
Begin VB.Label null0
Caption = "洪水名称"
Height = 255
Left = 240
TabIndex = 17
Top = 360
Width = 855
End
Begin VB.Label d14ddd
Caption = "洪水时间"
Height = 255
Left = 3840
TabIndex = 16
Top = 360
Width = 855
End
Begin VB.Label Label3
Caption = "受灾范围"
Height = 255
Left = 240
TabIndex = 15
Top = 960
Width = 855
End
Begin VB.Label Label4
Caption = "洪水深度"
Height = 255
Left = 3840
TabIndex = 14
Top = 960
Width = 855
End
Begin VB.Label Label5
Caption = "受灾人口"
Height = 255
Left = 240
TabIndex = 13
Top = 1560
Width = 855
End
Begin VB.Label Label7
Caption = "受灾面积"
Height = 255
Left = 3840
TabIndex = 12
Top = 1560
Width = 855
End
Begin VB.Label Label9
Caption = "作物损失"
Height = 255
Left = 240
TabIndex = 11
Top = 2160
Width = 855
End
Begin VB.Label Label11
Caption = "受灾损失"
Height = 255
Left = 3840
TabIndex = 10
Top = 2160
Width = 855
End
End
Begin VB.CommandButton cmdOK
Caption = "完 成"
Height = 375
Left = 2400
TabIndex = 0
Top = 6480
Width = 855
End
Begin MSComctlLib.ListView lstView
Height = 3375
Left = 120
TabIndex = 24
Top = 0
Width = 6975
_ExtentX = 12303
_ExtentY = 5953
LabelWrap = -1 'True
HideSelection = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
End
Attribute VB_Name = "frmInputFloodInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public bFlag As Boolean
Public txtPopuTab As String
Public txtAreaTab As String
Public txtCropLossTab As String
Public txtTotalLossTab As String
Public m_adoCnn As ADODB.Connection
Public m_infoRS As ADODB.Recordset
Private Sub Form_Load()
On Error GoTo ERH
txtName = theFloodName
txtDate = theFloodDate
txtRangeSde = m_txtRangeSde
txtDepthSde = m_txtDepthSde
txtPopuSde = m_txtPopuSde
txtPopuTab = "evalPopu"
txtAreaSde = m_txtAreaSde
txtAreaTab = "evalArea"
txtCropLossSde = m_txtCropLossSde
txtCropLossTab = "evalTotalCrop"
txtTotalLossSde = m_txtTotalLossSde
txtTotalLossTab = "evalLoss"
If m_adoCnn Is Nothing Then
MsgBox "连接有误" + Chr(13) + ERR.Description, vbInformation + vbYesonly, "信息提示"
Exit Sub
End If
Set m_infoRS = GetWritableRS("evalInfo", m_adoCnn)
If m_infoRS Is Nothing Then
MsgBox "连接有误" + Chr(13) + ERR.Description, vbInformation + vbYesonly, "信息提示"
Exit Sub
End If
Call ShowTable(m_infoRS, lstView)
' frmFloodTable.Show vbModal
Exit Sub
ERH:
MsgBox "显示洪水信息失败" + Chr(13) + ERR.Description, vbInformation + vbYesonly, "信息提示"
End Sub
Private Sub cmdCancel_Click()
bFlag = False
Unload Me
End Sub
Private Sub cmdOK_Click()
bFlag = True
Me.Hide
End Sub
Private Sub cmdAdd_Click()
Dim bFloodExist As Boolean
bFloodExist = recordExist("evalInfo", "FloodDate", txtDate, m_adoCnn)
Dim bWriteTable As Boolean
bWriteTable = True
If bFloodExist Then
Dim ret As Integer
ret = MsgBox("对不起,洪水信息已经存在," & Chr(13) & "如果需要刷新吗?", vbInformation + vbYesNo, "刷新信息")
If ret = vbYes Then
Call delRecords("evalInfo", "FloodDate", txtDate, m_adoCnn)
Else
bWriteTable = False
End If
End If
If bWriteTable Then
Call AppendEvalInfoRecord(m_infoRS, _
frmInputFloodInfo.txtName, _
frmInputFloodInfo.txtDate, _
frmInputFloodInfo.txtRangeSde, _
frmInputFloodInfo.txtDepthSde, _
frmInputFloodInfo.txtPopuSde, _
frmInputFloodInfo.txtPopuTab, _
frmInputFloodInfo.txtAreaSde, _
frmInputFloodInfo.txtAreaTab, _
frmInputFloodInfo.txtCropLossSde, _
frmInputFloodInfo.txtCropLossTab, _
frmInputFloodInfo.txtTotalLossSde, _
frmInputFloodInfo.txtTotalLossTab)
End If
End Sub
Private Sub cmdAreaSde_Click()
CommonDlg.DialogTitle = "请指定淹没面积图层名称"
CommonDlg.Filter = "Shape file(*.shp)|*.shp"
CommonDlg.ShowOpen
txtAreaSde = CommonDlg.FileName
End Sub
Private Sub cmdCropSde_Click()
CommonDlg.DialogTitle = "请指定作物评估图层名称"
CommonDlg.Filter = "GRID file(*.aux)|*.aux"
CommonDlg.ShowOpen
txtCropLossSde = CommonDlg.FileName
End Sub
Private Sub cmdDepth_Click()
CommonDlg.DialogTitle = "请指定淹没深度图层名称"
CommonDlg.Filter = "GRID file(*.aux)|*.aux"
CommonDlg.ShowOpen
txtDepthSde = CommonDlg.FileName
End Sub
Private Sub cmdLossSde_Click()
CommonDlg.DialogTitle = "请指定洪水损失图层名称"
CommonDlg.Filter = "GRID file(*.aux)|*.aux"
CommonDlg.ShowOpen
txtTotalLossSde = CommonDlg.FileName
End Sub
Private Sub cmdPopuSde_Click()
CommonDlg.DialogTitle = "请指定受灾人口图层名称"
CommonDlg.Filter = "Shape file(*.shp)|*.shp"
CommonDlg.ShowOpen
txtPopuSde = CommonDlg.FileName
End Sub
Private Sub cmdRange_Click()
CommonDlg.DialogTitle = "请指定受灾范围图层名称"
CommonDlg.Filter = "Shape file(*.shp)|*.shp"
CommonDlg.ShowOpen
txtRangeSde = CommonDlg.FileName
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?