📄 form5.frm
字号:
VERSION 5.00
Begin VB.Form Form5
BorderStyle = 0 'None
Caption = "编辑"
ClientHeight = 5085
ClientLeft = 4635
ClientTop = 2910
ClientWidth = 6045
LinkTopic = "Form5"
Picture = "Form5.frx":0000
ScaleHeight = 5085
ScaleWidth = 6045
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command4
Caption = "添加"
Height = 375
Left = 3480
Picture = "Form5.frx":58FF
Style = 1 'Graphical
TabIndex = 16
Top = 2280
Width = 855
End
Begin VB.TextBox Text7
BeginProperty Font
Name = "Kingsoft Phonetic Plain"
Size = 10.5
Charset = 2
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 14
Text = "i:AB:CC:U:Q[[:ZNWTFVu:59"
Top = 3000
Width = 2655
End
Begin VB.CommandButton Command3
Caption = "定位"
Height = 375
Left = 720
Picture = "Form5.frx":8C51
Style = 1 'Graphical
TabIndex = 13
Top = 2280
Width = 855
End
Begin VB.CommandButton Command1
Caption = "删除"
Height = 375
Left = 4560
Picture = "Form5.frx":CC8B
Style = 1 'Graphical
TabIndex = 12
Top = 2280
Width = 855
End
Begin VB.CommandButton Command2
Caption = "更新"
Height = 375
Left = 4560
Picture = "Form5.frx":FFDD
Style = 1 'Graphical
TabIndex = 11
Top = 2760
Width = 855
End
Begin VB.CommandButton Command5
Caption = "返回"
Height = 255
Left = 4320
Picture = "Form5.frx":11F0F
Style = 1 'Graphical
TabIndex = 10
Top = 3720
Width = 855
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 960
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "college_grade4"
Top = 4440
Visible = 0 'False
Width = 1620
End
Begin VB.TextBox Text4
DataField = "解释"
DataSource = "Data1"
Height = 300
Left = 3600
TabIndex = 4
Text = "Text4"
Top = 1800
Width = 1695
End
Begin VB.TextBox Text3
DataField = "音标"
DataSource = "Data1"
BeginProperty Font
Name = "Kingsoft Phonetic Plain"
Size = 9
Charset = 2
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 3600
TabIndex = 3
Text = "Text3"
Top = 1320
Width = 1695
End
Begin VB.TextBox Text2
DataField = "单词"
DataSource = "Data1"
Height = 270
Left = 3600
TabIndex = 2
Text = "Text2"
Top = 840
Width = 1695
End
Begin VB.TextBox Text1
DataSource = "Data1"
Height = 270
Left = 720
TabIndex = 1
Top = 1680
Width = 1215
End
Begin VB.ComboBox Combo1
DataSource = "Data1"
Height = 300
Left = 720
TabIndex = 0
Text = "请选择"
Top = 1080
Width = 1215
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "下框中音标为修改或添加条目时使用"
ForeColor = &H0000FFFF&
Height = 255
Left = 720
TabIndex = 15
Top = 2760
Width = 3135
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "添加查找内容"
ForeColor = &H0000FFFF&
Height = 255
Left = 720
TabIndex = 9
Top = 1440
Width = 1455
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "选择查找类别"
ForeColor = &H0000FFFF&
Height = 255
Left = 720
TabIndex = 8
Top = 840
Width = 1335
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "解释"
ForeColor = &H0000FFFF&
Height = 375
Left = 3000
TabIndex = 7
Top = 1800
Width = 375
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "音标"
ForeColor = &H0000FFFF&
Height = 375
Left = 3000
TabIndex = 6
Top = 1320
Width = 375
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "单词"
ForeColor = &H0000FFFF&
Height = 255
Left = 3000
TabIndex = 5
Top = 840
Width = 495
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetWindowRgn Lib "user32" _
( _
ByVal hWnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean _
) As Long
'声明设置窗口形状的API函数
Private Declare Function ReleaseCapture Lib "user32" _
( _
) As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
( _
ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any _
) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MOVE = &HF010&
Private Const HTCAPTION = 2
Private Sub Command6_Click()
Form6.Show
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
If Button = 1 Then
'如果按下鼠标左键
Dim ReturnVal As Long
X = ReleaseCapture()
ReturnVal = SendMessage(Form5.hWnd, WM_SYSCOMMAND, _
SC_MOVE + HTCAPTION, 0)
End If
End Sub
Private Sub Command1_Click()
If Data1.Recordset.RecordCount >= 1 Then
If MsgBox("删除记录将不能在恢复,确实要删除记录吗", vbYesNo, "信息提示") = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
Else
MsgBox "无可删除记录"
Exit Sub
End If
If Data1.Recordset.RecordCount >= 1 Then
Data1.Recordset.MoveLast
Else
MsgBox "数据已删空"
End If
End Sub
Private Sub Command2_Click()
Data1.UpdateRecord
Data1.Recordset.Bookmark = Data1.Recordset.LastModified
' Data1.Recordset.MoveLast
End Sub
Private Sub Command3_Click()
Me.MousePointer = 11
strRun = LTrim$(RTrim$(Combo1.Text))
Select Case strRun
Case Combo1.List(0):
Data1.RecordSource = "select * from College_Grade4 where 单词 = '" + Text1.Text + "'"
Data1.Refresh
Case Combo1.List(1): ' like" + Chr(34) + Text1.Text + "*" + Chr(34) + "" ='" + Text1.Text + "'"
Data1.RecordSource = "select * from College_Grade4 where 解释 = '" + Text1.Text + "'"
Data1.Refresh
End Select
If Data1.Recordset.RecordCount = 0 Then
MsgBox "数据库内未发现此条目"
End If
End Sub
Private Sub Command4_Click()
Form6.Show
End Sub
Private Sub Command5_Click()
Form5.Hide
End Sub
Private Sub Form_Load()
Combo1.AddItem "英文单词"
Combo1.AddItem "中文解释"
Data1.DatabaseName = App.Path & "\" & "Word" & "\" & "data.mdb"
liulan Form5
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -