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

📄 form0707.frm

📁 VB实验教程源码
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "输入学生信息"
   ClientHeight    =   3375
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5325
   LinkTopic       =   "Form1"
   ScaleHeight     =   3375
   ScaleWidth      =   5325
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "退出"
      Height          =   375
      Left            =   4080
      TabIndex        =   8
      Top             =   2760
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "后一个"
      Height          =   375
      Left            =   1680
      TabIndex        =   7
      Top             =   2760
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "前一个"
      Height          =   375
      Left            =   480
      TabIndex        =   6
      Top             =   2760
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "打开图片"
      Height          =   375
      Left            =   2880
      TabIndex        =   5
      Top             =   2760
      Width           =   975
   End
   Begin VB.Data Data1 
      Connect         =   "Access"
      DatabaseName    =   "C:\Documents and Settings\CAO Yi\My Documents\BookVBQH\BookVBQH\exe\db1.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   375
      Left            =   480
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "Student"
      Top             =   2280
      Visible         =   0   'False
      Width           =   2655
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   4680
      Top             =   240
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.TextBox Text2 
      DataField       =   "姓名"
      DataSource      =   "Data1"
      Height          =   495
      Left            =   1680
      TabIndex        =   3
      Top             =   1560
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      DataField       =   "学号"
      DataSource      =   "Data1"
      Height          =   495
      Left            =   1680
      TabIndex        =   1
      Top             =   600
      Width           =   1335
   End
   Begin VB.Label Label6 
      Caption         =   "照片"
      Height          =   255
      Left            =   3360
      TabIndex        =   4
      Top             =   360
      Width           =   1095
   End
   Begin VB.Image Image1 
      Height          =   1575
      Left            =   3240
      Stretch         =   -1  'True
      Top             =   840
      Width           =   1695
   End
   Begin VB.Label Label2 
      Caption         =   "姓名"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   1560
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "学号"
      Height          =   375
      Left            =   480
      TabIndex        =   0
      Top             =   600
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
'单击前一个按钮
    Data1.Recordset.MovePrevious
    If Data1.Recordset.BOF Then Data1.Recordset.MoveFirst
    If Data1.Recordset.Fields(6) <> "" Then
        Image1.Picture = LoadPicture(Data1.Recordset.Fields(6))
    Else
        Image1.Picture = LoadPicture("")
    End If
End Sub

Private Sub Command2_Click()
'单击后一个按钮
    Data1.Recordset.MoveNext
    If Data1.Recordset.EOF Then Data1.Recordset.MoveLast
    If Data1.Recordset.Fields(6) <> "" Then
        Image1.Picture = LoadPicture(Data1.Recordset.Fields(6))
    Else
        Image1.Picture = LoadPicture("")
    End If
End Sub

Private Sub Command3_Click()
'单击打开图片按钮
    With CommonDialog1
        .InitDir = "C:\"
        .Filter = "BMP文件(*.bmp)|*.bmp|GIF文件(*.gif)|*.gif|JPG文件(*.jpg)|*.jpg"
        .Action = 1
        Image1.Picture = LoadPicture(.FileName)       '装载图片框的图形文件
        Data1.Recordset.Edit
        Data1.Recordset.Fields(6) = .FileName
        Data1.Recordset.Update
    End With
End Sub

Private Sub Command4_Click()
'单击退出按钮
    End
End Sub

⌨️ 快捷键说明

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