学生信息登记系统VB试验报告二.控件属性变量
对象 属性 设置Form1 caption 首页Label1 caption 2008年4月26日Label2 caption 学生信息管理系统Label3 caption 制作人:===Commond1 caption 登陆Commond2 caption 取消Shape1 空 空
Form2 caption 登陆Label1 caption 欢迎使用本系统Label2 caption 用户名:Label3 caption 用户密码Label6 caption 登陆Shape1 空 空Commond1 caption 确定Commond2 caption 取消
Form3 caption 学生信息管理系统Label1 caption 姓名:Label2 caption 学号:Label3 caption 入学年月Label4 caption 所在学院Label5 caption 月Label6 caption 学生信息登记系统Label7 caption 年Shape1 空 空Text1 text 空Text2 text 空Combo1 text 空Combo2 text 空Combo3 text 空List1 空 空Commond1 caption 退出Commond2 caption 添加Commond3 caption 删除Commond4 caption 清空
三.程序清单FORM1Private Sub Command1_Click()Form2.ShowEnd SubPrivae Sub Label5_Click()End SubPrivate Sub Command2_Click()EndEnd SubFORM2Private Sub Picture1_Click()End SubPrivate Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)End SubPrivate Sub Command1_Click()If Text1.Text = "ABC" And Text2.Text = "123" ThenForm3.ShowElseAA = MsgBox("用户名或密码不正确,请重新输入", vbOKOnly, "警告")Text1.Text = ""Text2.Text = ""End IfEnd SubPrivate Sub Command2_Click()Unload MeEnd SubFORM3Private Sub Command1_Click()Unload MeEnd SubPrivate Sub Command2_Click()Dim iIf Text2.Text <> "" Theni = Text1.Text & " " & " " & Combo2.Text & "年" & Combo3.Text & "入学" & " " & " " & " " & " " & "学号:" & lwfree.cnEnd IfIf Text1.Text = "" ThenMsgBox "请输入姓名", vbOKOnly + EXCLAMATION, "警告"End IfIf Not IsNumeric(Trim(Text2.Text)) ThenMsgBox "请勿重复注册", vbOKOnly + EXCLAMATION, "警告"Exit SubText2.SetFocusEnd IfText1.Text = ""Text2.Text = ""End SubPrivate Sub Command3_Click()Dim i As IntegerIf List1.ListIndex >= 0 Then For i = List1.ListCount - 1 To 0 Step -1 If List1.Selected(i) Then List1.RemoveItem i '删除被选中的项目 Next iEnd IfEnd SubPrivate Sub Command4_Click()List1.Clear '清空列表End SubPrivate Sub Form_Load()Combo2.AddItem 2002Combo2.AddItem 2003Combo2.AddItem 2004Combo2.AddItem 2005Combo2.AddItem 2006Combo3.AddItem "9月"Combo3.AddItem "12月"Combo4.AddItem "外语学院"Combo4.AddItem "电信学院"Combo4.AddItem "工程学院"Combo4.AddItem "商学院"Combo3.Text = Combo3.List(0)Combo2.Text = Combo2.List(4)Combo4.Text = Combo4.List(1)End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then SendKeys "{tab}"End SubPrivate Sub Text2_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then SendKeys "{tab}"End Sub190