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

📄 form1.frm

📁 vb电子书籍
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00C0C0C0&
   ClientHeight    =   3705
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5895
   FillColor       =   &H00808080&
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   12
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   3705
   ScaleWidth      =   5895
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text4 
      Height          =   360
      Left            =   3720
      TabIndex        =   13
      Top             =   1440
      Width           =   375
   End
   Begin VB.TextBox Text3 
      Height          =   360
      Left            =   1080
      TabIndex        =   9
      Top             =   3120
      Width           =   855
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "性别"
      Height          =   855
      Left            =   360
      TabIndex        =   5
      Top             =   1920
      Width           =   2415
      Begin VB.OptionButton Option2 
         BackColor       =   &H00C0C0C0&
         Caption         =   "女"
         Height          =   375
         Left            =   1560
         TabIndex        =   7
         Top             =   360
         Width           =   495
      End
      Begin VB.OptionButton Option1 
         BackColor       =   &H00C0C0C0&
         Caption         =   "男"
         Height          =   375
         Left            =   600
         TabIndex        =   6
         Top             =   360
         Width           =   735
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "显示记录"
      Height          =   375
      Left            =   4440
      TabIndex        =   4
      Top             =   1920
      Width           =   1335
   End
   Begin VB.TextBox Text2 
      Height          =   360
      Left            =   960
      TabIndex        =   2
      Top             =   960
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   360
      Left            =   960
      TabIndex        =   1
      Top             =   480
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "追加记录"
      Height          =   375
      Left            =   4440
      TabIndex        =   0
      Top             =   1200
      Width           =   1335
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "记录号:"
      Height          =   240
      Left            =   2760
      TabIndex        =   12
      Top             =   1440
      Width           =   960
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Height          =   255
      Left            =   3960
      TabIndex        =   11
      Top             =   360
      Width           =   495
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "总记录数:"
      Height          =   240
      Left            =   2760
      TabIndex        =   10
      Top             =   360
      Width           =   1200
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "成绩:"
      Height          =   240
      Left            =   360
      TabIndex        =   8
      Top             =   3120
      Width           =   720
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "学号:        姓名:"
      Height          =   855
      Left            =   120
      TabIndex        =   3
      Top             =   480
      Width           =   735
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
Dim student As studtype
Dim record_no As Integer

'##################################################################
'## 过程名称:Command1_Click
'## 参数: 无
'##################################################################
Private Sub Command1_Click()
'    Text1.Text = ""
'    Text2.Text = ""
'    Text3.Text = ""
        With student
    .ino = Val(Text1.Text)
    .strname = Text2.Text
    .strsex = IIf(Option1.Value, "1", "0")
    .smark = Val(Text3.Text)
    End With
    Open "c:\student.dat" For Random As #1 Len = Len(student)
    record_no = record_no + 1
    Label4.Caption = record_no
    Put #1, record_no, student
    Close #1
    
End Sub
    
'##################################################################
'## 过程名称:Command2_Click
'## 参数: 无
'##################################################################
Private Sub Command2_Click()
    Open "c:\student.dat" For Random As #1 Len = Len(student)
    record_no = Val(Text4.Text)
    Get #1, record_no, student
    Text1.Text = student.ino
    Text2.Text = student.strname
    If student.strsex = "1" Then
        Option1.Value = True
    Else
        Option2.Value = True
    End If
    Text3.Text = student.smark
    record_no = LOF(1) / Len(student)
    Label4.Caption = record_no
    Close #1
    
End Sub
    
'##################################################################
'## 过程名称:Form_Load
'## 参数: 无
'##################################################################
Private Sub Form_Load()
    Open "c:\student.dat" For Random As #1 Len = Len(student)
    Label4.Caption = LOF(1) / Len(student)
    Close #1
End Sub

⌨️ 快捷键说明

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