📄 inputline.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form InputLine
BorderStyle = 3 'Fixed Dialog
Caption = "线路电量输入"
ClientHeight = 4200
ClientLeft = 45
ClientTop = 330
ClientWidth = 7890
Icon = "InputLine.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4200
ScaleWidth = 7890
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出(&Q)"
Height = 390
Left = 6255
TabIndex = 4
Top = 3660
Width = 1425
End
Begin VB.CommandButton Command1
Caption = "保存(&S)"
Height = 390
Left = 6240
TabIndex = 3
Top = 2925
Width = 1425
End
Begin VB.TextBox Text1
Height = 345
Left = 6225
MaxLength = 8
TabIndex = 2
Top = 2205
Width = 1425
End
Begin MSComctlLib.ListView ListView1
Height = 3825
Left = 165
TabIndex = 0
Top = 150
Width = 5760
_ExtentX = 10160
_ExtentY = 6747
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
_Version = 393217
Icons = "ImageList1"
ForeColor = 0
BackColor = 16777215
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 0
End
Begin MSComctlLib.ImageList ImageList1
Left = 15
Top = 4725
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "InputLine.frx":08CA
Key = ""
EndProperty
EndProperty
End
Begin VB.Image Image1
Height = 1350
Left = 6345
Picture = "InputLine.frx":11A4
Top = 135
Width = 1350
End
Begin VB.Label Label1
Caption = "本月供电量(&D):"
Height = 240
Left = 6240
TabIndex = 1
Top = 1845
Width = 1500
End
Begin VB.Shape Shape1
BorderColor = &H00808080&
Height = 4035
Index = 1
Left = 60
Top = 45
Width = 5985
End
Begin VB.Shape Shape1
BorderColor = &H00E0E0E0&
Height = 4035
Index = 0
Left = 90
Top = 60
Width = 5970
End
End
Attribute VB_Name = "InputLine"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Dim Li As ListItem
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
OpenMdb
Set MdbR = NdMd.OpenRecordset("乡镇档案")
With MdbR
While Not MdbR.eof
Set Li = ListView1.ListItems.Add(, , .Fields!镇代码 & .Fields!全称, 1)
.MoveNext
Wend
End With
' MdbR.Close
Command1.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
MdbR.Close
NdMd.Close
Set MdbR = Nothing
Set NdMd = Nothing
End Sub
Private Sub Text1_Change()
If Len(Trim(Text1)) > 0 Then
Call CheckIsNumber(Text1)
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Command1_Click
End If
End Sub
Private Sub Command1_Click()
Set MdbR = NdMd.OpenRecordset("SELECT 乡镇档案.镇代码,乡镇档案.简称,乡镇档案.[" & CC & "] AS 电量 FROM 乡镇档案 where 镇代码='" & Left(Trim(ListView1.SelectedItem), 3) & "'")
With MdbR
.Edit
.Fields!电量 = Val(Text1)
.Update
End With
MsgBox "数据已保存!", vbInformation
Exit Sub
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
Set MdbR = NdMd.OpenRecordset("SELECT 乡镇档案.镇代码,乡镇档案.简称,乡镇档案.[" & CC & "] AS 电量 FROM 乡镇档案 where 镇代码='" & Left(Trim(ListView1.SelectedItem), 3) & "'")
Text1 = MdbR.Fields!电量 & ""
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -