📄 frmmodifysinfo.frm
字号:
Height = 252
Left = 4560
TabIndex = 16
Top = 480
Width = 1092
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "性别"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 120
TabIndex = 15
Top = 960
Width = 1092
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "出生日期"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 4560
TabIndex = 14
Top = 1080
Width = 1092
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "班号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 120
TabIndex = 13
Top = 1560
Width = 1092
End
Begin VB.Label Label6
Alignment = 2 'Center
Caption = "联系电话"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 4560
TabIndex = 12
Top = 1560
Width = 1092
End
Begin VB.Label Label7
Alignment = 2 'Center
Caption = "入校日期"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 120
TabIndex = 11
Top = 2160
Width = 1092
End
Begin VB.Label Label8
Alignment = 2 'Center
Caption = "家庭住址"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Left = 4560
TabIndex = 10
Top = 2160
Width = 1092
End
Begin VB.Label Label9
Alignment = 2 'Center
Caption = "备注"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 120
TabIndex = 9
Top = 2760
Width = 1092
End
End
Attribute VB_Name = "frmModifysinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim tmpcolstudent As colstudent '现今class集合
Dim updatecolstudent As colstudent '要进行操作的class集合
Dim mcclean As Boolean '修改标记
Dim indicator As Integer '集合指示器
Private Sub editCommand_Click()
mcclean = False
Frame2.Enabled = False
firstCommand.Enabled = False
previousCommand.Enabled = False
nextCommand.Enabled = False
lastCommand.Enabled = False
txtSID.Enabled = True
txtName.Enabled = True
comboSex.Enabled = True
txtBorndate.Enabled = True
comboClassno.Enabled = True
txtRudate.Enabled = True
txtTel.Enabled = True
txtAddress.Enabled = True
txtComment.Enabled = True
End Sub
Private Sub cancelCommand_Click()
If Not mcclean Then
Frame2.Enabled = True
firstCommand.Enabled = True
previousCommand.Enabled = True
nextCommand.Enabled = True
lastCommand.Enabled = True
txtSID.Enabled = False
txtName.Enabled = False
comboSex.Enabled = False
txtBorndate.Enabled = False
comboClassno.Enabled = False
txtRudate.Enabled = False
txtTel.Enabled = False
txtAddress.Enabled = False
txtComment.Enabled = False
Call viewData
Else
MsgBox "什么都没有修改,有什么好取消的!", vbOKOnly + vbExclamation, "警告"
End If
End Sub
Private Sub firstCommand_Click()
If indicator > 1 Then
indicator = 1
Call viewData
End If
End Sub
Private Sub Form_Load()
Dim tmpcolclass As colclass
txtSID.Enabled = False
txtName.Enabled = False
comboSex.Enabled = False
txtBorndate.Enabled = False
comboClassno.Enabled = False
txtRudate.Enabled = False
txtTel.Enabled = False
txtAddress.Enabled = False
txtComment.Enabled = False
Set tmpcolstudent = New colstudent
Set updatecolstudent = New colstudent
tmpcolstudent.init
If tmpcolstudent.count < 1 Then
indicator = 0
Frame2.Enabled = False
Frame3.Enabled = False
Else
indicator = 1
End If
Call viewData
mcclean = True
End Sub
Public Sub viewData()
If indicator > 0 Then
txtSID.Text = tmpcolstudent.item(indicator).student_Id
txtName.Text = tmpcolstudent.item(indicator).student_Name
comboSex.Text = tmpcolstudent.item(indicator).student_Sex
txtBorndate.Text = Format(tmpcolstudent.item(indicator).born_date, "yyyy-mm-dd")
comboClassno.Text = tmpcolstudent.item(indicator).class_no
txtTel.Text = tmpcolstudent.item(indicator).tele_number
txtRudate.Text = Format(tmpcolstudent.item(indicator).ru_date, "yyyy-mm-dd")
txtAddress.Text = tmpcolstudent.item(indicator).address
txtComment.Text = tmpcolstudent.item(indicator).comment
Else
txtSID.Text = ""
txtName.Text = ""
comboSex.Text = ""
txtBorndate.Text = ""
comboClassno.Text = ""
txtTel.Text = ""
txtRudate.Text = ""
txtAddress.Text = ""
txtComment.Text = ""
End If
End Sub
Private Sub lastCommand_Click()
If indicator > 0 Then '有记录
indicator = tmpcolstudent.count
Call viewData
End If
End Sub
Private Sub nextCommand_Click()
If indicator < tmpcolstudent.count And indicator > 0 Then
indicator = indicator + 1
Call viewData
End If
End Sub
Private Sub previousCommand_Click()
If indicator > 1 Then
indicator = indicator - 1
Call viewData
End If
End Sub
Private Sub updateCommand_Click()
If mcclean Then
MsgBox "请先修改学籍信息", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Not Testtxt(txtSID.Text) Then
MsgBox "请输入学号!", vbOKOnly + vbExclamation, "警告"
txtSID.SetFocus
Exit Sub
End If
If Not Testtxt(txtName.Text) Then
MsgBox "请输入姓名!", vbOKOnly + vbExclamation, "警告"
txtName.SetFocus
Exit Sub
End If
If Not Testtxt(comboSex.Text) Then
MsgBox "请选择性别!", vbOKOnly + vbExclamation, "警告"
comboSex.SetFocus
Exit Sub
End If
If Not Testtxt(txtBorndate.Text) Then
MsgBox "请输入出生日期!", vbOKOnly + vbExclamation, "警告"
txtBorndate.SetFocus
Exit Sub
End If
If Not Testtxt(comboClassno.Text) Then
MsgBox "请选择班号!", vbOKOnly + vbExclamation, "警告"
comboClassno.SetFocus
Exit Sub
End If
If Not Testtxt(txtTel.Text) Then
MsgBox "请输入联系电话!", vbOKOnly + vbExclamation, "警告"
txtTel.SetFocus
Exit Sub
End If
If Not Testtxt(txtRudate.Text) Then
MsgBox "请输入入校日期!", vbOKOnly + vbExclamation, "警告"
txtRudate.SetFocus
Exit Sub
End If
If Not Testtxt(txtAddress.Text) Then
MsgBox "请输入家庭住址!", vbOKOnly + vbExclamation, "警告"
txtAddress.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtSID.Text)) Then
MsgBox "学号请输入数字!", vbOKOnly + vbExclamation, "警告"
txtSID.SetFocus
Exit Sub
End If
tmpcolstudent.item(indicator).State = 11
updatecolstudent.add tmpcolstudent.item(indicator) '添加到操作队列中
Call viewData
Frame2.Enabled = True
firstCommand.Enabled = True
previousCommand.Enabled = True
nextCommand.Enabled = True
lastCommand.Enabled = True
txtSID.Enabled = False
txtName.Enabled = False
comboSex.Enabled = False
txtBorndate.Enabled = False
comboClassno.Enabled = False
txtRudate.Enabled = False
txtTel.Enabled = False
txtAddress.Enabled = False
txtComment.Enabled = False
mcclean = True
End If
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -