📄 frm_stuedit.frm
字号:
VERSION 5.00
Begin VB.Form Frm_StuEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑学生信息"
ClientHeight = 1890
ClientLeft = 45
ClientTop = 330
ClientWidth = 7245
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1890
ScaleWidth = 7245
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "确 定"
Height = 495
Left = 1680
TabIndex = 4
Top = 1200
Width = 1815
End
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 495
Left = 3720
TabIndex = 5
Top = 1200
Width = 1815
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Frm_StuEdit.frx":0000
Left = 5040
List = "Frm_StuEdit.frx":000A
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 975
End
Begin VB.TextBox Text4
Alignment = 1 'Right Justify
Height = 270
Left = 5040
MaxLength = 2
TabIndex = 3
Top = 720
Width = 1935
End
Begin VB.TextBox Text3
Alignment = 1 'Right Justify
Height = 270
Left = 1440
MaxLength = 25
TabIndex = 2
Top = 720
Width = 1935
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Height = 270
Left = 1440
MaxLength = 25
TabIndex = 0
Top = 315
Width = 1935
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "成绩:"
Height = 180
Left = 3960
TabIndex = 9
Top = 765
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "职务:"
Height = 180
Left = 360
TabIndex = 8
Top = 765
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "性别:"
Height = 180
Left = 3960
TabIndex = 7
Top = 285
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "姓名:"
Height = 180
Left = 360
TabIndex = 6
Top = 360
Width = 540
End
End
Attribute VB_Name = "Frm_StuEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriStuId As Long
Private Sub Combo1_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub Command1_Click()
If Trim(Text1) = "" Then
MsgBox "请输入学生姓名"
Exit Sub
End If
With MyStu
'设置姓名
.Student_Name = MakeStr(Text1)
'设置性别
.Sex = Combo1.Text
'设置职务
.Title = MakeStr(Text3)
'设置成绩
.Score = Val(Text4)
If Modify = False Then
'插入新学生数据
.Insert
Else
'修改数据
.Update (OriStuId)
End If
End With
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Int(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -