?? frmadd_edit.vb
字號:
'************************************************************
'Copyright(c) 2007 長沙南方職業學院 信息系 軟件2-061班
'All rights reserved
'
'程序名稱:學?;拘畔⒐芾硐到y
'
'完成日期: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 + -