?? frm_adduser.frm
字號:
Height = 240
Left = 360
TabIndex = 38
Top = 2250
Width = 975
End
Begin VB.Label Label13
BackStyle = 0 'Transparent
Caption = "用戶密碼:"
Height = 345
Left = 360
TabIndex = 37
Top = 2760
Width = 960
End
Begin VB.Label Label14
BackStyle = 0 'Transparent
Caption = "用戶SIM號:"
Height = 330
Left = 360
TabIndex = 36
Top = 3270
Width = 1275
End
Begin VB.Label Label15
BackStyle = 0 'Transparent
Caption = "電價:"
Height = 300
Left = 360
TabIndex = 35
Top = 3750
Width = 870
End
Begin VB.Label Label16
BackStyle = 0 'Transparent
Caption = "用戶線路:"
Height = 300
Left = 5700
TabIndex = 34
Tag = "STRETCHH"
Top = 3750
Width = 945
End
Begin VB.Label Label17
BackStyle = 0 'Transparent
Caption = "用戶臺區:"
Height = 330
Left = 360
TabIndex = 33
Top = 4245
Width = 960
End
Begin VB.Label Label18
BackStyle = 0 'Transparent
Caption = "電能表編號:"
Height = 330
Left = 5700
TabIndex = 32
Tag = "STRETCHH"
Top = 360
Width = 1185
End
Begin VB.Label Label19
BackStyle = 0 'Transparent
Caption = "電能表型號:"
Height = 210
Left = 5700
TabIndex = 31
Tag = "STRETCHH"
Top = 960
Width = 1185
End
Begin VB.Label Label20
BackStyle = 0 'Transparent
Caption = "電能表常數:"
Height = 165
Left = 5700
TabIndex = 30
Tag = "STRETCHH"
Top = 1455
Width = 1185
End
Begin VB.Label Label21
BackStyle = 0 'Transparent
Caption = "變壓器編號:"
Height = 180
Left = 5700
TabIndex = 29
Tag = "STRETCHH"
Top = 2040
Width = 1185
End
Begin VB.Label Label22
BackStyle = 0 'Transparent
Caption = "變壓器型號:"
Height = 210
Left = 5700
TabIndex = 28
Tag = "STRETCHH"
Top = 2655
Width = 1185
End
Begin VB.Label Label23
BackStyle = 0 'Transparent
Caption = "互感器比例:"
Height = 330
Left = 5700
TabIndex = 27
Tag = "STRETCHH"
Top = 3150
Width = 1185
End
Begin VB.Label Label24
BackStyle = 0 'Transparent
Caption = "電能表起始讀數有功:"
Height = 285
Left = 360
TabIndex = 26
Top = 5325
Width = 1950
End
Begin VB.Label Label25
BackStyle = 0 'Transparent
Caption = "電能表起始讀數無功:"
Height = 285
Left = 5700
TabIndex = 25
Tag = "STRETCHH"
Top = 5325
Width = 1815
End
Begin VB.Label Label26
BackStyle = 0 'Transparent
Caption = "電能表起用日期:"
Height = 240
Left = 5640
TabIndex = 24
Tag = "STRETCHH"
Top = 4680
Width = 1485
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用戶地址:"
Height = 225
Left = 360
TabIndex = 23
Top = 4680
Width = 960
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "開戶日期:"
Height = 330
Left = 5700
TabIndex = 22
Tag = "STRETCHH"
Top = 4245
Width = 1185
End
End
End
End
Attribute VB_Name = "frm_adduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
txt_biaotime.Text = Format(Now, "yyyy-mm-dd hh:mm:ss")
txt_usertime.Text = Format(Now, "yyyy-mm-dd hh:mm:ss")
txt_biaosnumy.Text = "0"
txt_biaosnumn.Text = "0"
End Sub
Private Sub txt_biaoconst_Change()
Dim i As Integer
Dim str As String
If Trim(txt_biaoconst.Text) = "" Then Exit Sub
For i = 1 To Len(Trim(txt_biaoconst.Text))
If Asc(Mid(Trim(txt_biaoconst.Text), i, 1)) >= 48 And Asc(Mid(Trim(txt_biaoconst.Text), i, 1)) <= 57 Then
str = str & Mid(Trim(txt_biaoconst.Text), i, 1)
End If
Next i
txt_biaoconst.Text = str
End Sub
Private Sub txt_biaohao_Change()
Dim i As Integer
Dim str As String
If Trim(txt_biaohao.Text) = "" Then Exit Sub
For i = 1 To Len(Trim(txt_biaohao.Text))
If Asc(Mid(Trim(txt_biaohao.Text), i, 1)) >= 48 And Asc(Mid(Trim(txt_biaohao.Text), i, 1)) <= 57 Then
str = str & Mid(Trim(txt_biaohao.Text), i, 1)
End If
Next i
txt_biaohao.Text = str
End Sub
Private Sub txt_biaosnumn_Change()
Dim arr() As String
Dim num As Long
Dim num1 As Long
Dim senddata(3) As Byte
Dim str As String
Dim tempstr As String
Dim i As Integer
If Trim(txt_biaosnumn.Text) = "" Then Exit Sub
For i = 1 To Len(Trim(txt_biaosnumn.Text))
If Asc(Mid(Trim(txt_biaosnumn.Text), i, 1)) >= 48 And Asc(Mid(Trim(txt_biaosnumn.Text), i, 1)) <= 57 Then
str = str & Mid(Trim(txt_biaosnumn.Text), i, 1)
ElseIf Asc(Mid(Trim(txt_biaosnumn.Text), i, 1)) = 46 Then '小數點可以輸入
str = str & Mid(Trim(txt_biaosnumn.Text), i, 1)
End If
Next i
arr = VBA.Split(Trim(txt_biaosnumn.Text), ".", -1, vbTextCompare)
If UBound(arr) = 0 Then
num = Trim(txt_biaosnumn.Text)
num1 = 0
ElseIf UBound(arr) = 1 Then
If arr(0) = "" Then
MsgBox "請在小數點前加0!"
txt_biaosnumn.Text = ""
Exit Sub
End If
num = arr(0)
If arr(1) = "" Then
num1 = 0
Else
num1 = arr(1)
End If
Else
MsgBox "輸入的數值不能含兩個或兩個以上的小數點"
txt_biaosnumn.Text = ""
Exit Sub
End If
If num >= 0 And num <= 99 Then
senddata(0) = 0
senddata(1) = 0
senddata(2) = num
ElseIf num >= 100 And num <= 9999 Then
senddata(0) = 0
tempstr = num
str = Mid(tempstr, 1, 2)
senddata(1) = str
str = Mid(tempstr, 3)
senddata(2) = str
ElseIf num >= 10000 And num <= 999999 Then
tempstr = num
senddata(0) = Mid(tempstr, 1, 2)
senddata(1) = Mid(tempstr, 3, 2)
senddata(2) = Mid(tempstr, 5)
Else
MsgBox "只能輸入0-999999.99間的數據,請更正您的輸入"
txt_biaosnumn.Text = ""
Exit Sub
End If
If num1 < 0 Or num1 >= 100 Then
MsgBox "最多輸入2位小數請更正您的輸入"
txt_biaosnumn.Text = ""
Exit Sub
End If
senddata(3) = num1
End Sub
Private Sub txt_biaosnumy_Change() '表記起始讀數有功
Dim arr() As String
Dim num As Long
Dim num1 As Long
Dim senddata(3) As Byte
Dim str As String
Dim tempstr As String
Dim i As Integer
If Trim(txt_biaosnumy.Text) = "" Then Exit Sub
For i = 1 To Len(Trim(txt_biaosnumy.Text))
If Asc(Mid(Trim(txt_biaosnumy.Text), i, 1)) >= 48 And Asc(Mid(Trim(txt_biaosnumy.Text), i, 1)) <= 57 Then
str = str & Mid(Trim(txt_biaosnumy.Text), i, 1)
ElseIf Asc(Mid(Trim(txt_biaosnumy.Text), i, 1)) = 46 Then '小數點可以輸入
str = str & Mid(Trim(txt_biaosnumy.Text), i, 1)
End If
Next i
arr = VBA.Split(Trim(txt_biaosnumy.Text), ".", -1, vbTextCompare)
If UBound(arr) = 0 Then
num = Trim(txt_biaosnumy.Text)
num1 = 0
ElseIf UBound(arr) = 1 Then
If arr(0) = "" Then
MsgBox "請在小數點前加0!"
txt_biaosnumy.Text = ""
Exit Sub
End If
num = arr(0)
If arr(1) = "" Then
num1 = 0
Else
num1 = arr(1)
End If
Else
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -