📄 frmcode.frm
字号:
Width = 765
End
Begin VB.Label Label
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00808080&
BackStyle = 0 'Transparent
Caption = "Description"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 8
Left = 2160
TabIndex = 18
Top = 2880
Width = 1110
End
Begin VB.Label Label
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00808080&
BackStyle = 0 'Transparent
Caption = "Code"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 3
Left = 2790
TabIndex = 16
Top = 2160
Width = 480
End
Begin VB.Label Label
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00808080&
BackStyle = 0 'Transparent
Caption = "Value"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 7
Left = 2730
TabIndex = 15
Top = 2520
Width = 540
End
End
Begin VB.Shape Shape1
BorderColor = &H00FFFFFF&
BorderWidth = 2
Height = 6360
Left = 15
Top = 15
Width = 9300
End
End
Attribute VB_Name = "frmCodeFile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim dummy As adodb.Recordset
Dim datprimary As adodb.Recordset
Dim rec_Isnew As Boolean
Dim p_add, p_edit, p_save, p_undo, p_top, p_prev, p_next, p_last, p_del
Dim p_isadding, p_isediting, p_isnavigate
Private Sub cmdDel_Click()
On Error Resume Next
EditMode = True
Call MessageBox("frmCodeFile", "Are you sure you want to delete Code " + datprimary("CODE_NAME") + " ?", 1)
frmMessageBox2.Show
Call MacButton(" Delete", frmCodeFile.cmdDel, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdDel_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Delete", frmCodeFile.cmdDel, 0, 0, 73, 50, frmLogin.Source, 74, 0, 1)
End Sub
Private Sub cmdDel_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Delete", frmCodeFile.cmdDel, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdEdit_Click()
' On Error GoTo ErrorEdit
EditMode = True
Press_Buttons ("Edit")
txtField(1).SetFocus
txtField(0).TabStop = False
'ErrorEdit:
' Call MessageBox("frmCodeFile", Err.Description, 0)
End Sub
Private Sub cmdEdit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Edit", frmCodeFile.cmdEdit, 0, 0, 73, 50, frmLogin.Source, 74, 0, 1)
End Sub
Private Sub cmdEdit_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Edit", frmCodeFile.cmdEdit, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdExit_Click()
EditMode = False
Unload Me
End Sub
Private Sub cmdExit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Exit", frmCodeFile.cmdExit, 0, 0, 73, 50, frmLogin.Source, 74, 0, 1)
End Sub
Private Sub cmdExit_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Exit", frmCodeFile.cmdExit, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdFind_Click()
On Error Resume Next
EditMode = True
Call FindBox(" Find by Code ", _
"CODE_FILE", "CODE_NAME", 0, 1, "frmLogin")
Call MacButton(" Find", frmCodeFile.cmdFind, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Public Sub FindFileCode()
On Error Resume Next
strs = "select * from CODE_FILE where CODE_NAME = '" & frmFind.txtWord & "'"
Set dummy = New adodb.Recordset
dummy.Open strs, myDB, 1, 3
'Set dummy = frmLogin.db.OpenRecordset(strs)
If Not dummy.BOF Then
datprimary.MoveFirst
Do While Not datprimary.EOF
If datprimary("CODE_NAME") = frmFind.txtWord Then
Exit Do
End If
datprimary.MoveNext
Loop
Display_Fields
Enable_Buttons
Else
Call MessageBox("frmCodeFile", "Code not found", 0)
End If
End Sub
Private Sub cmdFind_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Find", frmCodeFile.cmdFind, 0, 0, 73, 50, frmLogin.Source, 74, 0, 1)
End Sub
Private Sub cmdFind_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Find", frmCodeFile.cmdFind, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdLast_Click()
Press_Buttons ("Last")
End Sub
Private Sub cmdLast_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("q", frmCodeFile.cmdLast, 0, 0, 100, 50, frmLogin.Source, 112, 39, 3)
End Sub
Private Sub cmdLast_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("q", frmCodeFile.cmdLast, 0, 0, 100, 50, frmLogin.Source, 138, 39, 3)
End Sub
Private Sub cmdNew_Click()
On Error Resume Next
EditMode = False
If datprimary.RecordCount = 0 Then
txtField(0).Text = "1"
Else
datprimary.MoveLast
txtField(0).Text = Val(datprimary("CODE_NAME")) + 1
End If
Press_Buttons ("New")
txtField(0).SetFocus
End Sub
Private Sub cmdNew_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" New", frmCodeFile.cmdNew, 0, 0, 73, 50, frmLogin.Source, 74, 0, 1)
End Sub
Private Sub cmdNew_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" New", frmCodeFile.cmdNew, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdNext_Click()
Press_Buttons ("Next")
End Sub
Private Sub cmdNext_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("u", frmCodeFile.cmdNext, 0, 0, 100, 49, frmLogin.Source, 112, 39, 3)
End Sub
Private Sub cmdNext_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("u", frmCodeFile.cmdNext, 0, 0, 100, 49, frmLogin.Source, 138, 39, 3)
End Sub
Private Sub cmdOk_Click()
BoxContainer2.Visible = False
End Sub
Private Sub cmdPrev_Click()
Press_Buttons ("Prev")
End Sub
Private Sub cmdPrev_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("t", frmCodeFile.cmdPrev, 0, 0, 100, 50, frmLogin.Source, 112, 39, 3)
End Sub
Private Sub cmdPrev_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("t", frmCodeFile.cmdPrev, 0, 0, 100, 50, frmLogin.Source, 138, 39, 3)
End Sub
Private Sub cmdSave_Click()
On Error Resume Next
If EditMode = True Then
Call MacButton(" Edit", frmCodeFile.cmdEdit, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Press_Buttons ("Save")
Else
Call MacButton(" New", frmCodeFile.cmdNew, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
If Get_File_Code Then
Call MessageBox("frmCodeFile", "Code already exists.", 0)
frmMessageBox.SetFocus
txtField(0) = ""
Press_Buttons ("Undo")
ElseIf txtField(0) = "" Then
Call MessageBox("frmCodeFile", "Code cannot be null", 0)
frmMessageBox.SetFocus
txtField(0) = ""
Press_Buttons ("Undo")
'ENABLE ONLY FOR SPECIFIC LENGTH OF 15 CHARACTERS NUMBERING
'ElseIf Len(txtField(0)) > 1 And Len(txtField(0)) < 15 Then
' Call MessageBox("frmCodeFile", "Code must be 15 in length", 0)
' frmMessageBox.SetFocus
' txtField(0) = ""
' Press_Buttons ("Undo")
Else
Press_Buttons ("Save")
End If
End If
Call MacButton(" Save", frmCodeFile.cmdSave, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdSave_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Save", frmCodeFile.cmdSave, 0, 0, 73, 50, frmLogin.Source, 74, 0, 1)
End Sub
Private Sub cmdSave_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Save", frmCodeFile.cmdSave, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdTop_Click()
Press_Buttons ("Top")
End Sub
Private Sub cmdTop_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("p", frmCodeFile.cmdTop, 0, 0, 100, 50, frmLogin.Source, 112, 39, 3)
End Sub
Private Sub cmdTop_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton("p", frmCodeFile.cmdTop, 0, 0, 100, 50, frmLogin.Source, 138, 39, 3)
End Sub
Private Sub cmdUndo_Click()
If EditMode = True Then
Call MacButton(" Edit", frmCodeFile.cmdEdit, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Else
Call MacButton(" New", frmCodeFile.cmdNew, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End If
Press_Buttons ("Undo")
Call MacButton(" Undo", frmCodeFile.cmdUndo, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub cmdUndo_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Undo", frmCodeFile.cmdUndo, 0, 0, 73, 50, frmLogin.Source, 74, 0, 1)
End Sub
Private Sub cmdUndo_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call MacButton(" Undo", frmCodeFile.cmdUndo, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End Sub
Private Sub Form_Activate()
On Error Resume Next
If EditMode = False Then
strs = "select * from CODE_FILE order by CODE_NAME"
Set datprimary = New adodb.Recordset
datprimary.Open strs, myDB, 1, 3
'Set datprimary = frmLogin.db.OpenRecordset(strs)
If Not datprimary.BOF Then
Display_Fields
End If
Enable_Fields (True)
Object_Tab_Trigger (False)
Enable_Buttons
Enable_Buttons
rec_Isnew = False
If cmdNew.Enabled Then cmdNew.SetFocus
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
Call ColForm(BoxContainer, 217, 211, 213, 125)
Call ColForm(ButtonContainer, 217, 211, 213, 125)
Call CreateMacOSTitleBar(titleBar, " Code File Setup ")
Call BitBlt(frmCodeFile.Closed.hDC, 0, 0, 73, 50, frmLogin.Source.hDC, 0, 107, SRCCOPY)
frmCodeFile.Closed.Refresh
Call BitBlt(frmCodeFile.Maximized.hDC, 0, 0, 73, 50, frmLogin.Source.hDC, 0, 72, SRCCOPY)
frmCodeFile.Maximized.Refresh
Call BitBlt(frmCodeFile.Minimized.hDC, 0, 0, 73, 50, frmLogin.Source.hDC, 0, 124, SRCCOPY)
frmCodeFile.Minimized.Refresh
KeyPreview = True
Call MacButton(" New", frmCodeFile.cmdNew, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Call MacButton(" Edit", frmCodeFile.cmdEdit, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Call MacButton(" Save", frmCodeFile.cmdSave, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Call MacButton(" Undo", frmCodeFile.cmdUndo, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Call MacButton(" Delete", frmCodeFile.cmdDel, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Call MacButton(" Find", frmCodeFile.cmdFind, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Call MacButton(" Exit", frmCodeFile.cmdExit, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
Call MacButton("p", frmCodeFile.cmdTop, 0, 0, 100, 50, frmLogin.Source, 138, 39, 3)
Call MacButton("u", frmCodeFile.cmdNext, 0, 0, 100, 50, frmLogin.Source, 138, 39, 3)
Call MacButton("t", frmCodeFile.cmdPrev, 0, 0, 100, 50, frmLogin.Source, 138, 39, 3)
Call MacButton("q", frmCodeFile.cmdLast, 0, 0, 100, 50, frmLogin.Source, 138, 39, 3)
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
On Error Resume Next
Dim AltDown
AltDown = (Shift And vbAltMask) > 0
Select Case KeyCode
Case vbKeyEscape:
Me.Hide
Case vbKeyN:
If AltDown Then
Call MacButton(" New", frmCodeFile.cmdNew, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
End If
Case vbKeyE:
If AltDown Then
Call MacButton(" Edit", frmCodeFile.cmdEdit, 0, 0, 73, 50, frmLogin.Source, 0, 0, 1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -