📄 frmvs.frm
字号:
VERSION 5.00
Begin VB.Form frmvs
BackColor = &H00C0E0FF&
Caption = "Search for Videos"
ClientHeight = 5325
ClientLeft = 60
ClientTop = 450
ClientWidth = 4350
ClipControls = 0 'False
Icon = "frmvs.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5325
ScaleWidth = 4350
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdexit
Caption = "&C a n c e l"
Height = 495
Left = 120
TabIndex = 16
Top = 4680
Width = 4095
End
Begin VB.Frame Frame1
BackColor = &H00000000&
Caption = "Search by:"
ClipControls = 0 'False
ForeColor = &H00FFFFFF&
Height = 855
Left = 120
TabIndex = 7
Top = 120
Width = 4095
Begin VB.CommandButton cmdclear
Caption = "&Clear"
Height = 375
Left = 3120
TabIndex = 13
Top = 240
Width = 735
End
Begin VB.TextBox txtsearchcode
Height = 375
Left = 840
TabIndex = 9
Top = 240
Width = 1095
End
Begin VB.CommandButton cmdsearch
Caption = "&Search"
Height = 375
Left = 2160
TabIndex = 8
Top = 240
Width = 735
End
Begin VB.Label lblcode
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "Code:"
ForeColor = &H00FFFFFF&
Height = 375
Left = 240
TabIndex = 10
Top = 360
Width = 855
End
End
Begin VB.Frame Frame2
BackColor = &H00000000&
Caption = "Video Details:"
ForeColor = &H00FFFFFF&
Height = 3375
Left = 120
MousePointer = 11 'Hourglass
TabIndex = 0
Top = 1200
Width = 4095
Begin VB.TextBox txtcode
Height = 375
Left = 1320
TabIndex = 15
Top = 1920
Width = 2535
End
Begin VB.TextBox Txtlang
Height = 375
Left = 1320
TabIndex = 12
Top = 1440
Width = 2535
End
Begin VB.TextBox txttitle
Height = 375
Left = 1320
TabIndex = 4
Top = 480
Width = 2535
End
Begin VB.TextBox txtrating
Enabled = 0 'False
Height = 375
Left = 1320
TabIndex = 3
Top = 960
Width = 2535
End
Begin VB.CommandButton cmdedit
Caption = "&Edit"
Height = 615
Left = 240
TabIndex = 2
Top = 2520
Width = 1695
End
Begin VB.CommandButton cmddel
Caption = "&Delete"
Height = 615
Left = 2160
TabIndex = 1
Top = 2520
Width = 1695
End
Begin VB.Label lblcode1
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "Code:"
ForeColor = &H00FFFFFF&
Height = 375
Left = 240
TabIndex = 14
Top = 2040
Width = 975
End
Begin VB.Label lbllang
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "Language"
ForeColor = &H00FFFFFF&
Height = 495
Left = 240
TabIndex = 11
Top = 1560
Width = 855
End
Begin VB.Label lbltitle
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "Title:"
ForeColor = &H00FFFFFF&
Height = 375
Left = 240
TabIndex = 6
Top = 480
Width = 1215
End
Begin VB.Label lblrate
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "Rating:"
ForeColor = &H00FFFFFF&
Height = 375
Left = 240
TabIndex = 5
Top = 960
Width = 1095
End
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 345
Left = 120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 5280
Visible = 0 'False
Width = 4020
End
End
Attribute VB_Name = "frmvs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdclear_Click()
txtsearchcode.Text = ""
txtsearchcode.SetFocus
End Sub
Private Sub cmddel_Click()
If txttitle <> "" Then
If MsgBox("Confirm to Delete the data?", vbYesNo) = vbYes Then
With Data1.Recordset
.FindFirst ("code='" & txtcode & "'")
If .NoMatch = False Then
.Delete
Call clearinfo
MsgBox "Data Deleted!", vbInformation
Else
MsgBox "No such record to delete!", vbInformation
Call clearinfo
End If
End With
Data1.Refresh
End If
Else
MsgBox "Please select a record to delete!", vbInformation
End If
End Sub
Private Sub cmdedit_Click()
If txttitle.Text <> "" Then
If MsgBox("Confirm to Edit the data?", vbYesNo) = vbYes Then
With Data1.Recordset
.FindFirst ("code='" & txtcode & "'")
If .NoMatch = False Then
.Edit
!Title = txttitle.Text
!rating = txtrating.Text
!language = Txtlang.Text
!code = txtcode.Text
.Update
Call clearinfo
MsgBox "Data Edited!", vbInformation
End If
End With
Data1.Refresh
End If
Else
MsgBox "Please select a record to edit!", vbInformation
End If
End Sub
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdsearch_Click()
If txtsearchcode.Text <> "" Then
Call searchcode
Else
MsgBox "Please enter the code you want to search for!", vbInformation
End If
End Sub
Private Sub searchcode()
With Data1.Recordset
.FindFirst ("code='" & txtsearchcode & "'")
If .NoMatch = False Then
Call displayinfo
Else
MsgBox "No record found!!!", vbInformation
txtsearchcode.Text = ""
txtsearchcode.SetFocus
End If
End With
End Sub
Private Sub displayinfo()
With Data1.Recordset
txttitle = !Title
txtrating = !rating
Txtlang = !language
txtcode = !code
End With
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "/video.mdb"
Data1.RecordSource = "SELECT * FROM video"
End Sub
Private Sub clearinfo()
txttitle.Text = ""
txtrating.Text = ""
Txtlang.Text = ""
txtcode.Text = ""
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -