⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 软件功能完善
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Begin VB.Menu back 
         Caption         =   "还书"
         Begin VB.Menu nor 
            Caption         =   "普通 "
            Shortcut        =   ^C
         End
         Begin VB.Menu accTime 
            Caption         =   "逾期 "
            Shortcut        =   ^D
         End
      End
      Begin VB.Menu line2 
         Caption         =   "-"
      End
      Begin VB.Menu backup 
         Caption         =   "数据备份"
         Shortcut        =   {F1}
      End
      Begin VB.Menu deleteBac 
         Caption         =   "删除备份"
         Shortcut        =   {F2}
      End
      Begin VB.Menu line1 
         Caption         =   "-"
      End
      Begin VB.Menu exit 
         Caption         =   "退出  "
         Shortcut        =   ^Q
      End
   End
   Begin VB.Menu admin 
      Caption         =   "数据管理(D)"
      Begin VB.Menu read 
         Caption         =   "借阅管理"
         Shortcut        =   ^E
      End
      Begin VB.Menu sno 
         Caption         =   "学号管理"
         Shortcut        =   ^F
      End
      Begin VB.Menu sb 
         Caption         =   "书号管理"
         Shortcut        =   ^G
      End
   End
   Begin VB.Menu search 
      Caption         =   "数据查询(S)"
      Begin VB.Menu info 
         Caption         =   "借阅情况"
         Shortcut        =   ^H
      End
      Begin VB.Menu book 
         Caption         =   "书库查询"
         Shortcut        =   ^I
      End
      Begin VB.Menu name 
         Caption         =   "学号查询"
         Shortcut        =   ^J
      End
   End
   Begin VB.Menu set 
      Caption         =   "系统设置(T)"
      Begin VB.Menu print 
         Caption         =   "打印"
         Shortcut        =   ^{F1}
      End
      Begin VB.Menu bg 
         Caption         =   "背景"
         Shortcut        =   ^K
      End
      Begin VB.Menu font 
         Caption         =   "字体"
         Shortcut        =   ^L
      End
      Begin VB.Menu Bset 
         Caption         =   "系统设置"
         Shortcut        =   ^M
      End
   End
   Begin VB.Menu help 
      Caption         =   "系统帮助(H)"
      Begin VB.Menu title 
         Caption         =   "主题"
         Shortcut        =   {F3}
      End
      Begin VB.Menu about 
         Caption         =   "关于..."
         Shortcut        =   {F4}
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'listview1功能介绍:用于显示(当读者借书/还书时)该读者已借阅的所有书籍,方便管理员及读者了解信息
'adodc1功能介绍:与datagrid1绑定,显示数据查询信息
Private Sub about_Click()
CommonDialog6.Action = 6
End Sub

Private Sub bg_Click()
CommonDialog4.Action = 3
End Sub

Private Sub font_Click()
CommonDialog3.Action = 4
End Sub

Private Sub print_Click()
CommonDialog5.Action = 5
End Sub

'数据查询的实现
Private Sub start_Click()
'对应不同的选项进行查询
On Error GoTo wrong
Dim LibName As String
If Combo1.ListIndex = -1 Or Text1.Text = "" Then
MsgBox "你没有输入查询内容或选择查询项"
Else
a = Text1.Text
Adodc1.CommandType = adCmdText
i = Combo1.ListIndex
b = Combo1.List(i)
Set DataGrid1.DataSource = Adodc1
Select Case SSTab1.Tab
Case 2
If i <> 6 Then
Adodc1.RecordSource = "select * from libary where " & b & " like '%" & a & "%'" '借阅信息查询

Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from libary "
Adodc1.Refresh
End If
Case 3
If i <> 7 Then
Adodc1.RecordSource = "select * from S_book where " & b & " like '%" & a & "%'" '书籍查询
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from S_book "
Adodc1.Refresh
End If
Case 4
If i <> 5 Then
Adodc1.RecordSource = "select * from S_no where " & b & " like '%" & a & "%'" '学号查询
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from S_no "
Adodc1.Refresh
End If
End Select
End If
L1.名称 = "共找到" & Adodc1.Recordset.RecordCount & "条记录"
Exit Sub
wrong:
MsgBox Err.Description
End Sub



Private Sub book_Click()
SSTab1.Tab = 3
With Combo1
.Clear
.Text = "请选择类别"
.AddItem "名称", 0
.AddItem "作者", 1
.AddItem "书号", 2
.AddItem "名称", 3
.AddItem "出版社", 4
.AddItem "出版时间", 5
.AddItem "内容介绍", 6
.AddItem "所有记录", 7
End With
Adodc1.Refresh
End Sub

Private Sub Bset_Click()
Sets.Show
End Sub
Private Sub Combo2_Click()
Text1 = Combo2.Text
Combo2.Visible = False
End Sub

Private Sub Combo2_LostFocus()
Combo2.Visible = False
End Sub

Private Sub exit_Click()
Unload Me
End Sub



Private Sub Form_Load()
frmSplash.Show
frmSplash.Refresh
Dim a1, a2
a1 = GetSetting("图书管理V1.0", "系统设置", "Btime", "Anonymous")
a2 = GetSetting("图书管理V1.0", "系统设置", "Ltime", "Anonymous")
If a1 = "Anonymous" Or a2 = "Anonymous" Then
SaveSetting "图书管理V1.0", "系统设置", "Btime", 2
SaveSetting "图书管理v1.0", "系统设置", "Ltime", 1
SaveSetting "图书管理v1.0", "系统设置", "Backup", 1
SaveSetting "图书管理v1.0", "系统设置", "Bcheck", 1
End If
start.Enabled = False
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2 '使窗体居中

If Not Form2.Data1.Recordset.EOF Then
Form2.Data1.Recordset.MoveLast
End If
start.Picture = ImageList1.ListImages(4).Picture

End Sub

'书籍管理
Private Sub info_Click()
SSTab1.Tab = 2
With Combo1
.Clear
.Text = "请选择类别"
.AddItem "学号", 0
.AddItem "书号", 1
.AddItem "书籍名称", 2
.AddItem "借书日期", 3
.AddItem "还书日期", 4
.AddItem "书籍介绍", 5
.AddItem "所有记录", 6
End With
Adodc1.Refresh
End Sub

Private Sub ListView1_BeforeLabelEdit(cancel As Integer)

End Sub
Private Sub Timer1_Timer()
Unload frmSplash
Timer1.Enabled = False
End Sub
'学号管理
Private Sub name_Click()
SSTab1.Tab = 4
With Combo1
.Clear
.Text = "请选择类别"
.AddItem "学号", 0
.AddItem "姓名", 1
.AddItem "性别", 2
.AddItem "专业", 3
.AddItem "学院", 4
.AddItem "所有记录", 5
End With
Adodc1.Refresh
End Sub
'还书
Private Sub nor_Click()
SSTab1.Tab = 1
Form2.Command3.Enabled = False
Form2.Caption = "还书"
Form2.Frame1.Caption = "还书"
Form2.Label3.Caption = "书号"
Form2.Label4.Caption = "确认"
Form2.Text9.Visible = False
Form2.Text10.Visible = False
Form2.Text7.Visible = True
Form2.Text8.Visible = True

Form2.Show
End Sub
'借书
Private Sub normal_Click()
SSTab1.Tab = 0
Form2.Text10.Visible = True
Form2.Text9.Visible = True
Form2.Text7.Visible = False
Form2.Text8.Visible = False

'得到借书日期和还书日期,由于时间关系,没有考虑闰年,及判断是否有30号
Dim a1 As Integer
a1 = GetSetting("图书管理V1.0", "系统设置", "Btime", "Anonymous")
Form2.Text11.Text = Year(Now()) & "年" & Month(Now()) & "月" & Day(Now()) & "日"
If Month(Now()) > 12 - a1 Then
Form2.Text12.Text = Year(Now()) + 1 & "年" & Month(Now()) + a1 - 12 & "月" & Day(Now()) & "日"
Else
Form2.Text12.Text = Year(Now()) & "年" & Month(Now()) + a1 & "月" & Day(Now()) & "日" '借书
End If
Form2.Show
BorrowFlag = True
End Sub
'书籍管理
Private Sub sb_Click()
sbook.Show
End Sub
'学号管理
Private Sub sno_Click()
S_admin.Show
End Sub
'续借
Private Sub special_Click()
SSTab1.Tab = 1
Form2.Command3.Enabled = False
Form2.Caption = "续借"
Form2.Frame1.Caption = "续借"
Form2.Label3.Caption = "书号"
Form2.Label4.Caption = "确认"
Form2.Text9.Visible = False
Form2.Text10.Visible = False
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Command2.Visible = True
Form2.Show
Dim a1 As Integer
a1 = GetSetting("图书管理V1.0", "系统设置", "Ltime", "Anonymous")
Form2.Text11.Text = Year(Now()) & "年" & Month(Now()) & "月" & Day(Now()) & "日"
If Month(Now()) > 12 - a1 Then
Form2.Text12.Text = Year(Now()) + 1 & "年" & Month(Now()) - 12 + a1 & "月" & Day(Now()) & "日"
Else
Form2.Text12.Text = Year(Now()) & "年" & Month(Now()) + a1 & "月" & Day(Now()) & "日" '续借
End If
End Sub

Private Sub SSTab1_Click(PreviousTab As Integer)
Select Case SSTab1.Tab
Case 2
info_Click
'即时更新adodc1的数据
Case 3
book_Click
Case 4
name_Click
End Select
End Sub

Private Sub SSTab1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Select Case SSTab1.Tab
Case 2
Combo1.Enabled = True
Combo1.Enabled = True
Text1.Enabled = True
start.Enabled = True
DataGrid1.Visible = True
start.Picture = ImageList1.ListImages(3).Picture

Case 3
Combo1.Enabled = True
Combo1.Enabled = True
Text1.Enabled = True
start.Enabled = True
DataGrid1.Visible = True
start.Picture = ImageList1.ListImages(3).Picture
Case 4
Combo1.Enabled = True
Combo1.Enabled = True
Text1.Enabled = True
start.Enabled = True
DataGrid1.Visible = True
start.Picture = ImageList1.ListImages(3).Picture
Case 0, 1
Combo1.Enabled = False
Combo1.Enabled = False
Text1.Enabled = False
start.Enabled = False
DataGrid1.Visible = False
start.Picture = ImageList1.ListImages(4).Picture '即时改变combol1,begin的状态,当切换到查询时有效
End Select
End Sub





Private Sub Text1_Click()
If Combo1.Text = "性别" Then
With Combo2
.Left = Text1.Left
.Top = Text1.Top + Text1.Height
Combo2.Visible = True
Combo2.SetFocus
End With
End If
End Sub

Private Sub Timer_Timer()
Unload frmSplash
Timer1.Enabled = False
End Sub

Private Sub title_Click()
frmSplash.Show
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim a1 As Integer
a1 = GetSetting("图书管理V1.0", "系统设置", "Bcheck", "Anonymous") '得到系统设置信息
Select Case Button.Index
Case 1
If a1 = 1 Then
PopupMenu Me.borrow, vbPopupMenuLeftAlign, Button.Left + 150, Button.Top + Button.Height + 150 '弹出选择菜单
Else
normal_Click
End If
Case 2
nor_Click
Case 3
If a1 = 1 Then
PopupMenu Me.search, vbPopupMenuLeftAlign, Button.Left + 150, Button.Top + Button.Height + 150 '弹出选择菜单
End If
Case 4
S_admin.Show
Case 5
sbook.Show
Case 6
Sets.Show
Case 8
CommonDialog1.Action = 2
Case 9
CommonDialog2.Action = 1
End Select
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -