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

📄 frmstuedit.frm

📁 简单的学生管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmStuEdit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑学生信息"
   ClientHeight    =   4875
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9225
   Icon            =   "FrmStuEdit.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4875
   ScaleWidth      =   9225
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确 定"
      Height          =   400
      Left            =   2950
      MouseIcon       =   "FrmStuEdit.frx":0CCA
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   4320
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Cancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   4975
      MouseIcon       =   "FrmStuEdit.frx":0FD4
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   4320
      Width           =   1300
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H80000004&
      ForeColor       =   &H00808000&
      Height          =   4095
      Left            =   240
      TabIndex        =   13
      Top             =   0
      Width           =   8775
      Begin VB.TextBox txtInDate 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   4320
         MaxLength       =   15
         TabIndex        =   28
         Top             =   2040
         Width           =   1455
      End
      Begin VB.TextBox txtBirth 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   1200
         MaxLength       =   15
         TabIndex        =   27
         Top             =   732
         Width           =   1815
      End
      Begin VB.TextBox txtStu_Name 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   1200
         MaxLength       =   15
         TabIndex        =   0
         Top             =   300
         Width           =   1815
      End
      Begin VB.ComboBox ComboSex 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         ItemData        =   "FrmStuEdit.frx":12DE
         Left            =   4320
         List            =   "FrmStuEdit.frx":12E8
         Style           =   2  'Dropdown List
         TabIndex        =   1
         Top             =   300
         Width           =   1455
      End
      Begin VB.TextBox txtNationality 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   7200
         MaxLength       =   15
         TabIndex        =   2
         Top             =   300
         Width           =   1455
      End
      Begin VB.TextBox txtId_Card 
         Height          =   300
         Left            =   1200
         MaxLength       =   20
         TabIndex        =   4
         Top             =   1164
         Width           =   4575
      End
      Begin VB.TextBox txtHomePhone 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   7200
         MaxLength       =   15
         TabIndex        =   6
         Top             =   1596
         Width           =   1455
      End
      Begin VB.TextBox txtPostcode 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   1200
         MaxLength       =   15
         TabIndex        =   8
         Top             =   2028
         Width           =   1455
      End
      Begin VB.TextBox txtTitle 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   7200
         MaxLength       =   15
         TabIndex        =   9
         Top             =   732
         Width           =   1455
      End
      Begin VB.TextBox txtResidence 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   1200
         MaxLength       =   15
         TabIndex        =   7
         Top             =   1596
         Width           =   4575
      End
      Begin VB.TextBox txtFamily_Place 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   4320
         MaxLength       =   15
         TabIndex        =   3
         Top             =   732
         Width           =   1455
      End
      Begin VB.TextBox txtMemo 
         Height          =   1380
         Left            =   1200
         MaxLength       =   15
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   10
         Top             =   2520
         Width           =   7455
      End
      Begin VB.TextBox txtBadgeID 
         Alignment       =   1  'Right Justify
         Height          =   300
         Left            =   7200
         MaxLength       =   15
         TabIndex        =   5
         Top             =   1164
         Width           =   1455
      End
      Begin VB.Label Label16 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "备注"
         Height          =   180
         Left            =   240
         TabIndex        =   26
         Top             =   2520
         Width           =   360
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "邮政编码"
         Height          =   180
         Left            =   240
         TabIndex        =   25
         Top             =   2088
         Width           =   720
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "出生日期"
         Height          =   180
         Left            =   240
         TabIndex        =   24
         Top             =   792
         Width           =   720
      End
      Begin VB.Label Label13 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "居住住址"
         Height          =   180
         Left            =   240
         TabIndex        =   23
         Top             =   1656
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "学生姓名"
         Height          =   180
         Left            =   240
         TabIndex        =   22
         Top             =   360
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "身份证号"
         Height          =   180
         Left            =   240
         TabIndex        =   21
         Top             =   1224
         Width           =   720
      End
      Begin VB.Label Label18 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "职务"
         Height          =   180
         Left            =   6120
         TabIndex        =   20
         Top             =   792
         Width           =   360
      End
      Begin VB.Label Label34 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "民族"
         Height          =   180
         Left            =   6120
         TabIndex        =   19
         Top             =   360
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "入校日期"
         Height          =   180
         Left            =   3360
         TabIndex        =   18
         Top             =   2088
         Width           =   720
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "家庭电话"
         Height          =   180
         Left            =   6120
         TabIndex        =   17
         Top             =   1656
         Width           =   720
      End
      Begin VB.Label Label25 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "籍贯"
         Height          =   180
         Left            =   3360
         TabIndex        =   16
         Top             =   792
         Width           =   360
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "性别"
         Height          =   180
         Left            =   3360
         TabIndex        =   15
         Top             =   360
         Width           =   360
      End
      Begin VB.Label Label21 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFC0C0&
         BackStyle       =   0  'Transparent
         Caption         =   "学生证号"
         Height          =   180
         Left            =   6120
         TabIndex        =   14
         Top             =   1224
         Width           =   720
      End
   End
End
Attribute VB_Name = "FrmStuEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean

Private Sub Cmd_Cancel_Click()
  FrmStuMan.TmpOk = False
  Unload Me
End Sub

Private Sub Cmd_OK_Click()
  With MyStu
  '姓名
  .Student_Name = MakeStr(txtStu_Name)
  '性别
  .Sex = ComboSex.Text
  '民族
  .Nationality = MakeStr(txtNationality)
  '生日
  If IsDate(txtBirth.Text) = False Then
    MsgBox "请选择正确的出生日期"
    Exit Sub
  End If
  .Birth = Trim(txtBirth.Text)
  '籍贯
  .Family_Place = MakeStr(txtFamily_Place)
  '身份证号
  .Id_Card = MakeStr(txtId_Card)
  '学生证号
  .BadgeID = MakeStr(txtBadgeID)
  '家庭电话
  .Home_phone = MakeStr(txtHomePhone)
  '居住地址
  .Residence = MakeStr(txtResidence)
  '邮政编号
  .Postcode = MakeStr(txtPostcode)
  '入校日期
  If IsDate(txtInDate.Text) = False Then
    MsgBox "请选择正确的入校日期"
    Exit Sub
  End If
  .InDate = Trim(txtInDate.Text)
  '职务
  .Title = MakeStr(txtTitle)
  '备注
  .Memo = MakeStr(txtMemo)
  '填表时间
  dd = Date
  dd = Format(dd, "yyyy-mm-dd")
  t = Time
  tt = Trim(Str(Hour(t))) + ":" + Trim(Str(Minute(t))) + ":" + Trim(Str(Second(t)))
  .Fillin_Time = dd + "  " + tt
  '院系班级编号
  .Class_Id = CurClass.Class_Id
  '根据变量Modify,判断是插入新数据,还是修改已有的数据
  If Modify = False Then
    .Insert
  Else
    .Update (CurStu.Student_Id)
  End If
  End With
  '设置学生管理窗体中的状态标识
  FrmStuMan.TmpOk = True
  Unload Me
End Sub

Private Sub Form_Load()
  If Modify = False Then
    txtStu_Name = ""
    ComboSex.ListIndex = 0
    txtNationality = ""
    txtBirth.Text = ""
    txtFamily_Place = ""
    txtId_Card = ""
    txtBadgeID = ""
    txtHomePhone = ""
    txtResidence = ""
    txtPostcode = ""
    txtInDate.Text = ""
    txtTitle = ""
    txtMemo = ""
  Else
    With CurStu
    '姓名
    txtStu_Name = .Student_Name
    '性别
    If InCombo(.Sex, ComboSex) = True Then
      ComboSex.Text = .Sex
    End If
    '民族
    txtNationality = .Nationality
    '生日
    txtBirth.Text = .Birth
    '籍贯
    txtFamily_Place = .Family_Place
    '身份证
    txtId_Card = .Id_Card
    '学生证
    txtBadgeID = .BadgeID
    '家庭电话
    txtHomePhone = .Home_phone
    '家庭住址
    txtResidence = .Residence
    '邮政编码
    txtPostcode = .Postcode
    '入校时间
    txtInDate.Text = .InDate
    '职务
    txtTitle = .Title
    '备注
    txtMemo = .Memo
    End With
  End If
End Sub

Private Sub txtBadgeID_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtStu_Name_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtFamily_Place_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtHomePhone_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtId_Card_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtMemo_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtNationality_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtPostcode_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
  If In_Int(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtResidence_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtTitle_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

⌨️ 快捷键说明

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