VB编写的课堂随机点名小程序代码.docx

上传人:小飞机 文档编号:3063077 上传时间:2023-03-10 格式:DOCX 页数:4 大小:37.35KB
返回 下载 相关 举报
VB编写的课堂随机点名小程序代码.docx_第1页
第1页 / 共4页
VB编写的课堂随机点名小程序代码.docx_第2页
第2页 / 共4页
VB编写的课堂随机点名小程序代码.docx_第3页
第3页 / 共4页
VB编写的课堂随机点名小程序代码.docx_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《VB编写的课堂随机点名小程序代码.docx》由会员分享,可在线阅读,更多相关《VB编写的课堂随机点名小程序代码.docx(4页珍藏版)》请在三一办公上搜索。

1、VB编写的课堂随机点名小程序代码随机点名系统。 综合网上各类小程序,自己修改定制了一款新的小程序。 学生名单.txt 放在同一个目录中。 使用截图如下 Private Declare Sub SetWindowPos Lib user32 (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) 定义常量 Const HWND_TOPMOST = -1 On Top

2、Const HWND_NOTOPMOST = -2 No Top Const SWP_NOACTIVATE = &H10 Const SWP_SHOWWINDOW = &H40 Dim TopOn As Integer Dim ss, mm, nn Dim num(1 To 300) As Integer Dim j, k As Integer Dim A(500) As String, r As Integer Dim filename As String Private Sub Command1_Click Dim b As String Dim t, i As Integer filen

3、ame = 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 If k = c Then Msg

4、Box 所有人员均已点过!, vbSystemModal Command1.Enabled = False Command3.Enabled = True End If End Sub Private Sub Command2_Click Unload Form1 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 = Name End Sub Private

5、Sub Command4_Click Timer1.Enabled = True Command4.Enabled = False End Sub Private Sub Data1_Validate(Action As Integer, Save As Integer) End Sub Private Sub Form_load Form1.Height = 500 Form1.Width = 8550 Command3.Enabled = False Timer1.Enabled = False nn = 0 mm = 45: ss = 0 Timer1.Interval = 1000 E

6、nd Sub Private Sub Timer1_Timer Dim M As Integer SetWindowPos Me.hwnd, HWND_TOPMOST, Me.Left / 15, _ Me.Top / 15, Me.Width / 15, _ Me.Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW Line1: If ss 10 Then s = 0 & ss Else s = ss End If If mm 0 Then mm = mm - 1: ss = 59 If mm = 0 And hh 0 Then hh = hh - 1: mm = 59 End Sub

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号