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

📄 frmgradecourse.frm

📁 员工培训系统
💻 FRM
字号:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SmartXPButton.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form FrmGradecourse 
   BackColor       =   &H00E7DFE7&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "课程培训需求"
   ClientHeight    =   5070
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   7440
   Icon            =   "FrmGradecourse.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Picture         =   "FrmGradecourse.frx":1CFA
   ScaleHeight     =   5070
   ScaleWidth      =   7440
   Begin VB.TextBox TxtcouName 
      Height          =   375
      Left            =   1320
      TabIndex        =   7
      Text            =   "Text2"
      Top             =   240
      Width           =   2055
   End
   Begin VB.TextBox TxtcouDes 
      Height          =   3015
      Left            =   240
      TabIndex        =   6
      Text            =   "Text1"
      Top             =   1080
      Width           =   3135
   End
   Begin SmartXPButton.XpButton cmdExit 
      Height          =   495
      Left            =   3000
      TabIndex        =   1
      Top             =   4440
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   873
      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         =   "关闭(&E)"
      CaptionMouseOverColor=   16711680
      PictureBackColor=   15790320
      PictureSmoothBackColor=   15790320
      ButtonPicture   =   "FrmGradecourse.frx":203C
   End
   Begin SmartXPButton.XpButton cmdSave 
      Height          =   495
      Left            =   720
      TabIndex        =   0
      Top             =   4440
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   873
      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         =   "保存(&S)"
      CaptionMouseOverColor=   16711680
      PictureBackColor=   15790320
      PictureSmoothBackColor=   15790320
      ButtonPicture   =   "FrmGradecourse.frx":2916
   End
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid Course_Grid 
      Height          =   3375
      Left            =   3840
      TabIndex        =   2
      Top             =   720
      Width           =   3370
      _ExtentX        =   5953
      _ExtentY        =   5953
      _Version        =   393216
      BackColorFixed  =   15196135
      BackColorBkg    =   15196135
      BackColorUnpopulated=   15196135
      _NumberOfBands  =   1
      _Band(0).Cols   =   2
   End
   Begin SmartXPButton.XpButton cmdDel 
      Height          =   495
      Left            =   5400
      TabIndex        =   8
      Top             =   4440
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   873
      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         =   "删除(&D)"
      CaptionMouseOverColor=   16711680
      PictureBackColor=   15790320
      PictureSmoothBackColor=   15790320
      ButtonPicture   =   "FrmGradecourse.frx":2F50
   End
   Begin VB.Label Label3 
      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            =   240
      TabIndex        =   5
      Top             =   720
      Width           =   1455
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "需求列表:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   210
      Left            =   3840
      TabIndex        =   4
      Top             =   240
      Width           =   1050
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "课程名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   210
      Left            =   240
      TabIndex        =   3
      Top             =   285
      Width           =   840
   End
End
Attribute VB_Name = "FrmGradecourse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim myCourse As OpenRs



Private Sub cmdExit_Click()
Unload Me
End Sub


Private Sub Text1_Change()

End Sub


Private Sub Cmdsave_Click()
On Error Resume Next
If TxtcouName.Text = Empty Then
    MsgBox "请输入课程名称!", vbOKOnly + vbInformation, "提示"
    TxtcouName.SetFocus
    Exit Sub
End If

If TxtcouDes.Text = Empty Then
    MsgBox "请输入需求分析!", vbOKOnly + vbInformation, "提示"
    TxtcouDes.SetFocus
    Exit Sub
End If


If cmdSave.Caption = "保存(&S)" Then
    myCourse.rsDK1 "select * from course_need"
    With myCourse.rs1
        .AddNew
        !course_name = TxtcouName.Text
        !course_des = TxtcouDes.Text
        .Update
    End With
    myCourse.rsDK1 "select * from course_need"
    Set Course_Grid.DataSource = myCourse.rs1
    Course_Grid.FormatString = "  | 课程名  |             需求分析         "
    MsgBox "信息已成功添加!", vbOKOnly + vbInformation, "提示"
   cmdDel.Enabled = False
    cmdSave.Caption = "保存(&S)"
    cmdSave.Enabled = True
   TxtcouName.Text = ""
    TxtcouDes.Text = ""
Else
    
     myCourse.rsDK1 "select * from course_need where course_name='" & TxtcouName.Text & "'"
    With myCourse.rs1
      
        !course_name = TxtcouName.Text
        !course_des = TxtcouDes.Text
        .Update
    End With
    cmdDel.Enabled = True
    MsgBox "课程信息已成功更新!", vbOKOnly + vbInformation, "提示"
    
    cmdSave.Caption = "保存(&S)"
    cmdSave.Enabled = True
  
    myCourse.rsDK1 "select * from course_need"
    Set Course_Grid.DataSource = myCourse.rs1
    Course_Grid.FormatString = "  | 课程名  |             需求分析         "
End If
End Sub

Private Sub Course_Grid_Click()
    myCourse.rsDK1 "select * from course_need"
If Not myCourse.rs1.EOF Then
    TxtcouName.Text = Course_Grid.TextMatrix(Course_Grid.Row, 1)
    TxtcouDes.Text = Course_Grid.TextMatrix(Course_Grid.Row, 2)
    cmdSave.Enabled = True
    cmdDel.Enabled = True
    cmdSave.Caption = "更新(&U)"
End If
End Sub

Private Sub Form_Load()
On Error Resume Next
    Set myCourse = New OpenRs
    Course_Grid.FormatString = "  | 课程名  |             需求分析"
    myCourse.rsDK1 "select * from course_need"

    
    Set Course_Grid.DataSource = myCourse.rs1
    Course_Grid.FormatString = "  | 课程名  |             需求分析"
    Call ClearText

    cmdSave.Caption = "保存(&S)"
    cmdSave.Enabled = True
    
End Sub

Public Sub ClearText()
TxtcouName.Text = ""
TxtcouDes.Text = ""
End Sub

Private Sub TxtcouDes_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then KeyAscii = 0
End Sub

Private Sub TxtcouName_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then KeyAscii = 0
End Sub

Private Sub cmdDel_Click()
On Error Resume Next

If TxtcouName.Text = "" Then
   MsgBox "请选择要删除的记录!", vbOKOnly + vbInformation, "删除记录"
   Exit Sub
End If
If MsgBox("确认要删除课程名为 " & TxtcouName.Text & " 的记录吗?", vbOKCancel + vbQuestion, "删除记录") = vbOK Then
   myCourse.rsDK1 "select * from course_need where course_name='" & TxtcouName.Text & "'"
   myCourse.rs1.Delete
   myCourse.rsDK1 "select * from course_need"
   If myCourse.rs1.EOF Then
       Course_Grid.Clear
       Course_Grid.FormatString = "  | 课程名  |             需求分析"
   Else
       
       Course_Grid.FormatString = "  | 课程名  |             需求分析"
       Set Course_Grid.DataSource = myCourse.rs1
   End If
   cmdDel.Enabled = False
   cmdSave.Caption = "保存(&S)"
   TxtcouName.Text = ""
   TxtcouDes.Text = ""
   myCourse.rsDK1 "select * from course_need"
   Set Course_Grid.DataSource = myCourse.rs1
    Course_Grid.FormatString = "  | 课程名  |             需求分析"
End If
End Sub

⌨️ 快捷键说明

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