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

📄 frmadd_edit.vb

📁 师生情况管理系统
💻 VB
字号:
'************************************************************
'Copyright(c) 2007 长沙南方职业学院 信息系 软件2-061班
'All rights reserved
'
'程序名称:学校基本信息管理系统
'
'作者(原):易湘陵
'完成日期:2007-11-14
'作者(改):
'修改日期:
'************************************************************
Public Class FrmAdd_Edit
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()
        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    Public Sub New(ByVal GetId As String, ByVal GetName As String)
        MyBase.New()
        ShareID = GetId
        ShareName = GetName
        EditYorN = True
        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化
    End Sub

    '窗体重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意: 以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents BtnSave As System.Windows.Forms.Button
    Friend WithEvents BtnCancel As System.Windows.Forms.Button
    Friend WithEvents TxtID As System.Windows.Forms.TextBox
    Friend WithEvents TxtName As System.Windows.Forms.TextBox
    Friend WithEvents LabID As System.Windows.Forms.Label
    Friend WithEvents LabName As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.TxtID = New System.Windows.Forms.TextBox
        Me.TxtName = New System.Windows.Forms.TextBox
        Me.LabID = New System.Windows.Forms.Label
        Me.LabName = New System.Windows.Forms.Label
        Me.BtnSave = New System.Windows.Forms.Button
        Me.BtnCancel = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'TxtID
        '
        Me.TxtID.Location = New System.Drawing.Point(64, 22)
        Me.TxtID.Name = "TxtID"
        Me.TxtID.Size = New System.Drawing.Size(144, 21)
        Me.TxtID.TabIndex = 0
        Me.TxtID.Text = ""
        '
        'TxtName
        '
        Me.TxtName.Location = New System.Drawing.Point(64, 54)
        Me.TxtName.Name = "TxtName"
        Me.TxtName.Size = New System.Drawing.Size(144, 21)
        Me.TxtName.TabIndex = 0
        Me.TxtName.Text = ""
        '
        'LabID
        '
        Me.LabID.Location = New System.Drawing.Point(24, 24)
        Me.LabID.Name = "LabID"
        Me.LabID.Size = New System.Drawing.Size(64, 16)
        Me.LabID.TabIndex = 1
        Me.LabID.Text = "编号"
        '
        'LabName
        '
        Me.LabName.Location = New System.Drawing.Point(24, 56)
        Me.LabName.Name = "LabName"
        Me.LabName.Size = New System.Drawing.Size(64, 16)
        Me.LabName.TabIndex = 1
        Me.LabName.Text = "名称"
        '
        'BtnSave
        '
        Me.BtnSave.Location = New System.Drawing.Point(32, 96)
        Me.BtnSave.Name = "BtnSave"
        Me.BtnSave.TabIndex = 2
        Me.BtnSave.Text = "确定"
        '
        'BtnCancel
        '
        Me.BtnCancel.Location = New System.Drawing.Point(136, 96)
        Me.BtnCancel.Name = "BtnCancel"
        Me.BtnCancel.TabIndex = 2
        Me.BtnCancel.Text = "取消"
        '
        'FrmAdd_Edit
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(242, 133)
        Me.Controls.Add(Me.TxtID)
        Me.Controls.Add(Me.TxtName)
        Me.Controls.Add(Me.BtnSave)
        Me.Controls.Add(Me.LabID)
        Me.Controls.Add(Me.LabName)
        Me.Controls.Add(Me.BtnCancel)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
        Me.Name = "FrmAdd_Edit"
        Me.Text = "FrmAdd_Edit"
        Me.ResumeLayout(False)

    End Sub

#End Region


    Public ShareID As String = ""
    Public ShareName As String = ""
    Public EditYorN As Boolean = False  '是否是修改
    Public SaveZT As Boolean = False

    Private Sub FrmAdd_Edit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If EditYorN Then
            Me.Text = "修改"
            TxtID.Text = ShareID
            TxtName.Text = ShareName
        Else
            Me.Text = "添加"
            TxtID.Text = ""
            TxtName.Text = ""
        End If
    End Sub

    Private Sub BtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSave.Click
        ShareID = TxtID.Text.Trim
        ShareName = TxtName.Text.Trim
        SaveZT = True
        Me.Close()
    End Sub


    Private Sub BtnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCancel.Click
        ShareID = ""
        ShareName = ""
        Me.Close()
    End Sub
End Class

⌨️ 快捷键说明

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