📄 practice9_3.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "图书资料列表管理"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command6
Caption = "最后一个"
Height = 375
Left = 3360
TabIndex = 6
Top = 2640
Width = 1215
End
Begin VB.CommandButton Command5
Caption = "第一个"
Height = 375
Left = 3360
TabIndex = 5
Top = 2160
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "下移一个"
Height = 375
Left = 3360
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "上移一个"
Height = 375
Left = 3360
TabIndex = 3
Top = 1200
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 375
Left = 3360
TabIndex = 2
Top = 720
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 3360
TabIndex = 1
Top = 240
Width = 1215
End
Begin VB.ListBox List1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2790
ItemData = "practice9_3.frx":0000
Left = 240
List = "practice9_3.frx":0028
TabIndex = 0
Top = 240
Width = 3015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
addit = Trim(InputBox("请输入书名", 注意))
If addit <> "" Then
List1.AddItem addit
End If
End Sub
Private Sub Command2_Click()
If List1.ListCount = 0 Then
MsgBox "列表中已经没有书", , "注意"
Exit Sub
End If
If List1.ListIndex >= 0 Then
List1.RemoveItem List1.ListIndex
Else
MsgBox "请先选择某本书", , "注意"
End If
End Sub
Private Sub Command3_Click()
Select Case List1.ListIndex
Case 0
MsgBox "不能上移", , "注意"
Case -1
MsgBox "请先选择", , "注意"
Case Else
n = List1.ListIndex
a = List1.List(n - 1)
List1.List(n - 1) = List1.List(n)
List1.List(n) = a
List1.Selected(n - 1) = True
End Select
End Sub
Private Sub Command4_Click()
Select Case List1.ListIndex
Case List1.ListCount - 1
MsgBox "不能下移", , "注意"
Case -1
MsgBox "请先选择", , "注意"
Case Else
n = List1.ListIndex
a = List1.List(n + 1)
List1.List(n + 1) = List1.List(n)
List1.List(n) = a
List1.Selected(n + 1) = True
End Select
End Sub
Private Sub Command5_Click()
List1.Selected(0) = True
End Sub
Private Sub Command6_Click()
List1.Selected(List1.ListCount - 1) = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -