欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

form2.frm

学生信息管理系统 学生信息管理系统
FRM
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Begin VB.Form Form2 
   BorderStyle     =   0  'None
   Caption         =   "Form2"
   ClientHeight    =   2175
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4515
   LinkTopic       =   "Form2"
   Picture         =   "Form2.frx":0000
   ScaleHeight     =   2175
   ScaleWidth      =   4515
   StartUpPosition =   2  '屏幕中心
   Begin VB.Timer Timer1 
      Interval        =   10
      Left            =   4080
      Top             =   1320
   End
   Begin StoneXP.XPButton XPButton2 
      Height          =   375
      Left            =   2520
      TabIndex        =   5
      Top             =   1800
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   661
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "离 开"
      MouseIcon       =   "Form2.frx":458D
      MousePointer    =   99
   End
   Begin StoneXP.XPButton XPButton1 
      Height          =   375
      Left            =   600
      TabIndex        =   4
      Top             =   1800
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   661
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "确 定"
      MouseIcon       =   "Form2.frx":48A7
      MousePointer    =   99
   End
   Begin VB.TextBox Text1 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      Height          =   270
      Index           =   1
      Left            =   1200
      TabIndex        =   3
      Top             =   1200
      Width           =   2295
   End
   Begin VB.TextBox Text1 
      Alignment       =   1  'Right Justify
      Appearance      =   0  'Flat
      Height          =   270
      Index           =   0
      Left            =   1200
      TabIndex        =   1
      Top             =   810
      Width           =   1455
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "新系别与班级添加(保留其中一个输入框为空)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   0
      TabIndex        =   6
      Top             =   0
      Width           =   3495
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "新班级:"
      Height          =   255
      Index           =   1
      Left            =   480
      TabIndex        =   2
      Top             =   1200
      Width           =   1095
   End
   Begin VB.Image Image1 
      Height          =   310
      Left            =   4140
      MouseIcon       =   "Form2.frx":4BC1
      MousePointer    =   99  'Custom
      Top             =   40
      Width           =   310
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "新系别:"
      Height          =   255
      Index           =   0
      Left            =   480
      TabIndex        =   0
      Top             =   840
      Width           =   1095
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Form_Load()
Form2.BackColor = RGB(97, 69, 133)
For i = 0 To 1
Text1(i).BackColor = Form2.BackColor
Next
XPButton1.Default = True
End Sub

Private Sub Image1_Click()
Unload Me
End Sub

Private Sub Timer1_Timer()
If duixiang = 1 Then
Label1(0).Caption = "新系列:"
Label1(1).Caption = "新班级:"
Label2.Caption = "新系别与班级添加"
End If
Timer1.Interval = 0
End Sub

Private Sub XPButton1_Click()
If duixiang = 1 Then
        If qy2.State = adStateOpen Then '检测系别是否在列表中
         qy2.Close
        End If
         If Text1(0).Text <> "" Then
           qy2.Open "select * from 系别 where 系别='" & Text1(0).Text & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
                    If qy2.EOF = True Then
             qy2.AddNew
             qy2.Fields(0) = Text1(0).Text
             qy2.Update
             Text1(0).Text = ""
             MsgBox "添加成功,继续操作", vbInformation, "添加成功"
            Else
            MsgBox "该数据己经存在,无须再次添加!", vbInformation, "数据重名"
            End If
         ElseIf Text1(1).Text <> "" Then
           qy2.Open "select * from 班级 where 班级='" & Text1(1).Text & "'", cnn, adOpenKeyset, adLockOptimistic, adCmdText
            If qy2.EOF = True Then
             qy2.AddNew
             qy2.Fields(0) = Text1(1).Text
             qy2.Update
             Text1(1).Text = ""
             MsgBox "添加成功,继续操作", vbInformation, "添加成功"
            Else
            MsgBox "该数据己经存在,无须再次添加!", vbInformation, "数据重名"
            End If
         End If
 End If
End Sub

Private Sub XPButton2_Click()
Unload Me
End Sub

⌨️ 快捷键说明

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