📄 frmfamilyedit.vb
字号:
Class FrmFamilyEdit
Inherits System.Windows.Forms.Form
Public Modify As Boolean '插入=false,修改=true
Public VarEmpId As Integer
Public OriId As Short
Private Sub Cmd_Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmd_Cancel.Click
Me.Close()
End Sub
Private Sub txtAge_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAge.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
If In_Int(KeyAscii) = False Then
KeyAscii = 0
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub
Private Sub BtnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click
If Len(Trim(txtName.Text)) = 0 Then
MsgBox("请输入姓名")
txtName.Focus()
txtName.SelectionStart = 0
txtName.SelectionLength = Len(txtName.Text)
Exit Sub
End If
With MyFam
.Name = Trim(txtName.Text)
.Sex = Trim(ComboSex.Text)
.Age = Val(txtAge.Text)
.Relationship = Trim(txtRelation.Text)
.WorkingOrg = Trim(txtWorkingOrg.Text)
If Modify = False Then
.Insert((VarEmpId))
Else
.Update(VarEmpId, OriId)
End If
End With
Me.Close()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -