课堂教学小助手源代码
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。
课堂教学小助手源代码 Form1代码: Private Sub Command1_Click() Unload Form1 Form3.Show End Sub Private Sub Command2_Click() Unload Form1 Form2.Show End Sub Private Sub Form_Load() Show A = Format(Date, \b = Format(Time, \Print Print Print \ 今天是\Print Print , b Print Print \ 请先设置要上的课程\Print End Sub Form2代码: Private Declare Function SetWindowPos Lib \(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Const HWND_TOPMOST& = -1 ' 将窗口置于列表顶部,并位于任何最顶部窗口的前面 Private Const SWP_NOSIZE& = &H1 ' 保持窗口大小 Private Const SWP_NOMOVE& = &H2 ' 保持窗口位置 Dim j, k As Integer Dim A(500) As String, r As Integer Dim filename As String Dim num(1 To 300) As Integer Private Sub Command5_Click() Form1.Show Unload Form2 End Sub Private Sub Form_Load() SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE ' 将窗口设为在所有窗口前端 Command3.Enabled = False Command4.Enabled = False Timer1.Enabled = False 1 / 3 Timer1.Interval = 1000 End Sub Private Sub Command1_Click() Dim b As String Dim t, i As Integer filename = App.Path & \学生名单.txt\Open filename For Input As #1 '产生记录总数以内的随机数x i = 1 While Not EOF(1) Line Input #1, A(i) i = i + 1 Wend c = i Close #1 Start: Randomize t = Int(c * Rnd + 1) For j = 1 To c If t = num(j) Then GoTo Start End If Next Label1.Caption = A(t) k = k + 1 num(k) = t Command4.Enabled = True If k = c Then MsgBox \所有人员均已点过!\Command1.Enabled = False Command3.Enabled = True End If End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Command3_Click() j = 0 k = 0 For i = 1 To 300 num(i) = 0 Next Command3.Enabled = False Command1.Enabled = True Label1.Caption = \学生姓名\ End Sub Private Sub Command4_Click() Label2.Caption = 20 Timer1.Enabled = True Command4.Enabled = False End Sub Private Sub Label2_Click() End Sub Private Sub Timer1_Timer() 2 / 3 Label2.Caption = Val(Label2.Caption) - 1 If Label2.Caption = 0 Then MsgBox \你的回答已超时\ Timer1.Enabled = False Label2.Caption = \End If End Sub Form3代码: Private Sub Command1_Click() Select Case -1 Case Is = List2.ListIndex MsgBox \请输入星期几?\Case Is = List3.ListIndex MsgBox \请输入时间(早晨或上午或下午)!\Case Is = List4.ListIndex MsgBox \请输入第几节课!\Case Is = List5.ListIndex MsgBox \请输入哪个班级的课!\Case Is = List6.ListIndex MsgBox \请输入几小时!\Case Is = List7.ListIndex MsgBox \请输入几分!\Case Else If List1.ListCount = 0 Then List1.List(0) = \总共有\ \节课\Else List1.List(0) = \总共有\ \节课\End If List1.AddItem List2.Text & \ \ \ \\ \开始时间\ \时\分\End Select End Sub Private Sub Command2_Click() Unload Form3 Form1.Show End Sub Private Sub Command3_Click() If List1.ListIndex = -1 Then MsgBox \请选择某节课程,然后再删除!\End If For i = List1.ListCount - 1 To 1 Step -1 If List1.Selected(i) = True Then List1.RemoveItem i List1.List(0) = \总共有\ \节课\End If Next i End Sub Private Sub Command4_Click() List1.Clear List1.List(0) = \目前没有要上的科目\End Sub Private Sub Form_Load() End Sub 3 / 3 本文来源:https://www.wddqw.com/doc/35bf55b8ad1ffc4ffe4733687e21af45b207fe0a.html