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

📄 mdi.frm

📁 这是我自己做的系统 很不完善 不足之处请多多指教!
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmStuEdit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑学生信息"
   ClientHeight    =   6645
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7530
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6645
   ScaleWidth      =   7530
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Cmdcancel 
      Caption         =   " 取消"
      Height          =   615
      Left            =   4320
      TabIndex        =   30
      Top             =   5880
      Width           =   1455
   End
   Begin VB.CommandButton Cmdok 
      Caption         =   "确定"
      Height          =   615
      Left            =   1320
      TabIndex        =   29
      Top             =   5880
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Height          =   5655
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   7335
      Begin VB.TextBox Text11 
         Height          =   1695
         Left            =   1080
         TabIndex        =   28
         Top             =   3840
         Width           =   5775
      End
      Begin VB.TextBox Text10 
         Height          =   375
         Left            =   5880
         TabIndex        =   26
         Top             =   3120
         Width           =   1335
      End
      Begin VB.ComboBox Combo3 
         Height          =   300
         Left            =   3600
         TabIndex        =   24
         Top             =   3120
         Width           =   1335
      End
      Begin VB.TextBox Text9 
         Height          =   375
         Left            =   1200
         TabIndex        =   22
         Top             =   3240
         Width           =   1455
      End
      Begin VB.TextBox Text8 
         Height          =   495
         Left            =   5880
         TabIndex        =   20
         Top             =   2280
         Width           =   1215
      End
      Begin VB.TextBox Text7 
         Height          =   495
         Left            =   1080
         TabIndex        =   18
         Top             =   2400
         Width           =   3855
      End
      Begin VB.TextBox Text6 
         Height          =   495
         Left            =   5880
         TabIndex        =   16
         Top             =   1680
         Width           =   1335
      End
      Begin VB.TextBox Text5 
         Height          =   495
         Left            =   1080
         TabIndex        =   14
         Top             =   1680
         Width           =   3735
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   5760
         TabIndex        =   12
         Top             =   960
         Width           =   1215
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   3840
         TabIndex        =   10
         Top             =   960
         Width           =   1095
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   1200
         TabIndex        =   8
         Top             =   1200
         Width           =   1215
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   5760
         TabIndex        =   6
         Top             =   360
         Width           =   1095
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "mdi.frx":0000
         Left            =   3840
         List            =   "mdi.frx":000A
         TabIndex        =   4
         Top             =   360
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Height          =   495
         Left            =   1200
         TabIndex        =   2
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label Label14 
         Caption         =   "备注"
         Height          =   615
         Left            =   240
         TabIndex        =   27
         Top             =   3600
         Width           =   855
      End
      Begin VB.Label Label13 
         Caption         =   "职务"
         Height          =   495
         Left            =   5160
         TabIndex        =   25
         Top             =   3120
         Width           =   495
      End
      Begin VB.Label Label12 
         Caption         =   "入校日期"
         Height          =   495
         Left            =   2640
         TabIndex        =   23
         Top             =   3120
         Width           =   1215
      End
      Begin VB.Label Label11 
         Caption         =   "邮政编码"
         Height          =   495
         Left            =   120
         TabIndex        =   21
         Top             =   3120
         Width           =   1095
      End
      Begin VB.Label Label10 
         Caption         =   "家庭电话"
         Height          =   495
         Left            =   5040
         TabIndex        =   19
         Top             =   2400
         Width           =   975
      End
      Begin VB.Label Label9 
         Caption         =   "居住地址"
         Height          =   495
         Left            =   120
         TabIndex        =   17
         Top             =   2520
         Width           =   975
      End
      Begin VB.Label Label8 
         Caption         =   "学生证号"
         Height          =   495
         Left            =   5040
         TabIndex        =   15
         Top             =   1800
         Width           =   975
      End
      Begin VB.Label Label7 
         Caption         =   "身份证号"
         Height          =   495
         Left            =   240
         TabIndex        =   13
         Top             =   1800
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "籍贯"
         Height          =   495
         Left            =   5040
         TabIndex        =   11
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label5 
         Caption         =   "政治面貌"
         Height          =   375
         Left            =   2760
         TabIndex        =   9
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "出生日期"
         Height          =   495
         Left            =   240
         TabIndex        =   7
         Top             =   1200
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "民族"
         Height          =   375
         Left            =   5160
         TabIndex        =   5
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "性别"
         Height          =   495
         Left            =   2880
         TabIndex        =   3
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "学生姓名"
         Height          =   375
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   1095
      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 Cmdcancel_Click()
  FrmStuMan.TmpOk = False
  Unload Me
End Sub

Private Sub Cmdok_Click()
 With MyStu
  '姓名
  .Student_Name = MakeStr(txtStu_Name)
  '性别
  .Sex = ComboSex.Text
  '民族
  .Nationality = MakeStr(txtNationality)
  '生日
  If IsDate(ComboBirth.Text) = False Then
    MsgBox "请选择正确的出生日期"
    Exit Sub
  End If
  .Birth = ComboBirth.Text
  '政治面貌
  .Political_Party = MakeStr(txtPolitical_Party)
  '籍贯
  .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(ComboInDate.Text) = False Then
    MsgBox "请选择正确的入校日期"
    Exit Sub
  End If
  .InDate = ComboInDate.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 Combo2_Change()
FrmDateSel.Show
End Sub

Private Sub Combo2_GotFocus()
 Text3.SetFocus
  '如果ComboBirth中包含日期,则将它赋值到FrmDateSel中
  If Combo2.Text <> "" Then
    FrmDateSel.OriDate = Combo2.Text
  Else
    FrmDateSel.OriDate = ""
  End If
  '设置FrmDateSel窗体的位置
  FrmDateSel.Left = Me.Left + Combo2.Left + 350
  FrmDateSel.Top = Me.Top + Combo2.Top + Combo2.Height + 450
  FrmDateSel.Show 1
  '将选择的日期显示到ComboBirth控件中
  Combo2.Text = FrmDateSel.OriDate
End Sub

Private Sub Combo3_Change()

End Sub

Private Sub Combo3_GotFocus()
 Text10.SetFocus
  
  If Combo3.Text <> "" Then
    FrmDateSel.OriDate = Combo3.Text
  Else
    FrmDateSel.OriDate = ""
  End If
  FrmDateSel.Left = Me.Left + Combo3.Left
  FrmDateSel.Top = Me.Top + Combo3.Top + Combo3.Height - FrmDateSel.Height
  
  FrmDateSel.Show 1
  
  Combo3.Text = FrmDateSel.OriDate
End Sub

Private Sub Form_Load()
 If Modify = False Then
    Text1 = ""
    Combo1.ListIndex = 0
    Text2 = ""
    Combo2.Text = ""
     Text3 = ""
     Text4 = ""
    Text5 = ""
     Text6 = ""
   Text7 = ""
   Text8 = ""
  Text9 = ""
    Combo3.Text = ""
   Text10 = ""
   Text11 = ""
  Else
    With CurStu
    '姓名
    txtStu_Name = .Student_Name
    '性别
    If InCombo(.Sex, Combo1) = True Then
      Combo1.Text = .Sex
    End If
    '民族
    txtNationality = .Nationality
    '生日
    ComboBirth.Text = .Birth
    '政治面貌
    txtPolitical_Party = .Political_Party
    '籍贯
    txtFamily_Place = .Family_Place
    '身份证
    txtId_Card = .Id_Card
    '学生证
    txtBadgeID = .BadgeID
    '家庭电话
    txtHomePhone = .Home_phone
    '家庭住址
    txtResidence = .Residence
    '邮政编码
    txtPostcode = .Postcode
    '入校时间
    ComboInDate.Text = .InDate
    '职务
    txtTitle = .Title
    '备注
    txtMemo = .Memo
    End With
  End If
End Sub

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub Text6_Change()
 EnterTAB (KeyAscii)
End Sub

⌨️ 快捷键说明

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