📄 songmanger.frm
字号:
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 375
Left = 0
TabIndex = 4
Top = 30
Width = 1335
End
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 3720
Top = 0
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MCI.MMControl MMControl1
Height = 495
Left = 120
TabIndex = 0
Top = 0
Visible = 0 'False
Width = 3540
_ExtentX = 6244
_ExtentY = 873
_Version = 393216
DeviceType = ""
FileName = ""
End
Begin VB.Menu popmenu
Caption = "导入"
Visible = 0 'False
Begin VB.Menu singlefile
Caption = "单个文件"
End
Begin VB.Menu folder
Caption = "目录"
End
End
End
Attribute VB_Name = "songManger"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim filename As String
Dim menuFlag As String
Dim fileB As String
Dim fileE As String
Private Sub Command1_Click()
Dim f As Boolean
Dim f1 As Boolean
f1 = False
For i = 1 To List1.ListCount
If Trim(Text1.Text) = Left(List2.list(i - 1), 6) Then f1 = True
Next
If f1 = False Then
MsgBox "对不起,没有此曲目.", vbOKOnly, "警告"
Exit Sub
Else
End If
If Label6.Caption <> "" Then
f = True
For i = 1 To List3.ListCount
If List3.list(i - 1) = Trim(Text1.Text) Then f = False
Next
If f = True Then List3.AddItem Label6.Caption & Trim(Text1.Text)
Else
MsgBox "请先选择台号!", vbOKOnly, "警告"
End If
End Sub
Private Sub Command2_Click()
Dim s As String
For i = 1 To List3.ListCount
s = List3.list(i - 1)
addTxt s
Next
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub folder_Click()
menuFlag = "folder"
Tfolder.Show 1
End Sub
Private Sub Form_Load()
Dim sql As String
On Error Resume Next
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\song.mdb;Persist Security Info=False"
With Adodc1
.ConnectionString = conn1
.CommandTimeout = 30
.CommandType = adCmdText
.CursorLocation = adUseClient
.RecordSource = "select 包厢号 from 包厢号 where 状态='有客'"
.Refresh
End With
On Error Resume Next
For i = 1 To Adodc1.Recordset.RecordCount
List1.AddItem Adodc1.Recordset.Fields("包厢号")
Adodc1.Recordset.MoveNext
Next
With Adodc2
.ConnectionString = conn
.CommandTimeout = 30
.CommandType = adCmdText
.CursorLocation = adUseClient
.RecordSource = "select * from songlist"
.Refresh
End With
For i = 1 To Adodc2.Recordset.RecordCount
List2.AddItem Adodc2.Recordset.Fields("编号") & "| " & Adodc2.Recordset.Fields("歌名")
Adodc2.Recordset.MoveNext
Next
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set mHZtoSM = Nothing
End Sub
Private Sub Image1_Click()
If List2.list(List2.ListIndex) <> "" Then
List3.AddItem Left(List2.list(List2.ListIndex), 6)
List2.RemoveItem List2.ListIndex
End If
End Sub
Private Sub List1_Click()
If List1.list(List1.ListIndex) <> "" Then
Label6.Caption = List1.list(List1.ListIndex)
End If
End Sub
Private Sub List2_DblClick()
Dim f As Boolean
If Label6.Caption <> "" Then
f = True
If List2.list(List2.ListIndex) <> "" Then
For i = 1 To List3.ListCount
If List3.list(i - 1) = Left(List2.list(List2.ListIndex), 6) Then f = False
Next
If f = True Then List3.AddItem Label6.Caption & Left(List2.list(List2.ListIndex), 6)
End If
Else
MsgBox "请先选择台号!", vbOKOnly, "警告"
End If
End Sub
Private Sub Option1_Click()
On Error Resume Next
List1.Clear
If Option1.Value = True Then
Adodc1.RecordSource = "select 包厢号 from 包厢号 where 状态='有客'"
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
List1.AddItem Adodc1.Recordset.Fields("包厢号")
Adodc1.Recordset.MoveNext
Next
End If
End Sub
Private Sub Option2_Click()
On Error Resume Next
List1.Clear
If Option2.Value = True Then
Adodc1.RecordSource = "select 桌号 from 桌号 where 状态='有客'"
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
List1.AddItem Adodc1.Recordset.Fields("桌号")
Adodc1.Recordset.MoveNext
Next
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim f As Boolean
Dim f1 As Boolean
If KeyAscii = 13 Then
f1 = False
For i = 1 To List1.ListCount
If Trim(Text1.Text) = Left(List2.list(i - 1), 6) Then f1 = True
Next
If f1 = False Then
MsgBox "对不起,没有此曲目.", vbOKOnly, "警告"
Exit Sub
Else
End If
If Label6.Caption <> "" Then
f = True
For i = 1 To List3.ListCount
If List3.list(i - 1) = Trim(Text1.Text) Then f = False
Next
If f = True Then List3.AddItem Label6.Caption & Trim(Text1.Text)
Else
MsgBox "请先选择台号!", vbOKOnly, "警告"
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -