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

📄 frmpic.frm

📁 第一次用VB编写的图书管理系统,仅供大家参考,呵呵,不足之处多多包含
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmPic 
   Caption         =   "Form1"
   ClientHeight    =   2565
   ClientLeft      =   2100
   ClientTop       =   2340
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   2565
   ScaleWidth      =   4680
   Begin VB.CommandButton cmdCha 
      Caption         =   "|<"
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   7
      Top             =   1800
      Width           =   495
   End
   Begin VB.CommandButton cmdCha 
      Caption         =   "<"
      Height          =   255
      Index           =   1
      Left            =   720
      TabIndex        =   6
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton cmdCha 
      Caption         =   ">"
      Height          =   255
      Index           =   2
      Left            =   1185
      TabIndex        =   5
      Top             =   1800
      Width           =   375
   End
   Begin VB.CommandButton cmdCha 
      Caption         =   ">|"
      Height          =   255
      Index           =   3
      Left            =   1545
      TabIndex        =   4
      Top             =   1800
      Width           =   495
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "关 闭"
      Height          =   375
      Left            =   600
      TabIndex        =   3
      Top             =   1200
      Width           =   1095
   End
   Begin VB.TextBox txt 
      Height          =   270
      Left            =   840
      TabIndex        =   2
      Top             =   2215
      Width           =   3735
   End
   Begin VB.CommandButton CmdDel 
      Caption         =   "删 除"
      Height          =   375
      Left            =   600
      TabIndex        =   1
      Top             =   720
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "增 加"
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   240
      Width           =   1095
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "图片路径"
      Height          =   180
      Left            =   90
      TabIndex        =   8
      Top             =   2270
      Width           =   720
   End
   Begin VB.Image Img 
      BorderStyle     =   1  'Fixed Single
      Height          =   1980
      Left            =   2520
      Stretch         =   -1  'True
      Top             =   120
      Width           =   1980
   End
End
Attribute VB_Name = "FrmPic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCha_Click(Index As Integer)
On Error GoTo Cha_Err
Select Case Index
 Case 0: DBRct_M.MoveFirst
 Case 1: DBRct_M.MovePrevious: If DBRct_M.BOF Then DBRct_M.MoveLast
 Case 2: DBRct_M.MoveNext: If DBRct_M.EOF Then DBRct_M.MoveFirst
 Case 3: DBRct_M.MoveLast
End Select
 txt = DBRct_M.Fields("Path").Value
 Img.Picture = LoadPicture(txt)
Cha_Err:
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub cmdDel_Click()
On Error GoTo D_Err
If MsgBox("要删除" & DBRct_M.Fields("Path") & "吗?", vbInformation + vbYesNo, "确认") <> vbYes Then Exit Sub
 DBRct_M.Delete
 DBRct_M.Fields.Refresh
 MsgBox "删除成功", vbInformation, "成功"
 cmdCha_Click (2)
D_Err:
End Sub

Private Sub Command1_Click()
On Error GoTo Add_Err
If txt = Empty Then MsgBox "路径不能为空!", vbInformation, "警告"
QueryInfo ("select path from pic where path='" & Choose(txt) & "'")
If Not DBRct.EOF Then MsgBox "路径已经存在!", vbInformation, "重复": Exit Sub
Img.Picture = LoadPicture(txt)
DBRct_M.AddNew
DBRct_M.Fields(2) = Choose(txt)
DBRct_M.Update
MsgBox "增加信息成功!", vbInformation, "成功"
Exit Sub
Add_Err:
MsgBox "图片不存在!请检查路径!", vbInformation, "路径错误"
End Sub

Private Sub Form_Load()
If DBRct_M.EOF Then Exit Sub
cmdCha_Click (0)
End Sub

Private Sub Form_Resize()
If Me.Height <= 500 Or Me.Width <= 1500 Then Exit Sub
Me.Height = 2970
Me.Width = 4800
End Sub

⌨️ 快捷键说明

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