定title的移动宽度
bScrollState = False
''设定缺省的开始滚动方向为向左
m_nSelectNum = 0
''初始化被选定数为0
Init
''初始化本
程序的界面
End Sub
Private Sub Timer_FlashName_Timer() ''闪动中奖者姓名
If Label_FlashName.Visible = True Then
Label_FlashName.Visible = False
Else
Label_FlashName.Visible = True
End If
End Sub
Private Sub Timer_ScrollName_Timer() ''滚动出现名字
If m_bIsStart = True Then
If m_nNameIndex >= MAX_INDEX Then
m_nNameIndex = 0
End If
m_nNameIndex =m_nNameIndex + 1
If m_strNameArray(m_nNameIndex).bIsSelect = True Then
If m_nNameIndex < MAX-INDEX Then
m_nNameIndex =
m_nNameIndex + 1
Else
m_nNameIndex = 0
End If
End If
Label_ScrollName.Caption = m_str
NameArray(m_nNameIndex).strName
''End If
End If
End Sub
Private Sub Timer_ScrollTitle_Timer() ''滚动“恭喜发财"字样
If bScrollState = False Then ''向左滚
nScrollStep = 10
Label_Congruation.Caption = m_strScrollTitleLeft
If nScrollWidth > 0 Then
nScrollWidth =
nScrollWidth - nScrollStep
Else
bScrollState = True
End If
Else ''向右滚
nScrollStep = -10
Label_Congruation.Caption =
m_strScrollTitleRight
If nScrollWidth < Form_Bouns.ScaleWidth -
Label_Congruation.Width Then
nScrollWidth =
nScrollWidth - nScrollStep
Else
bScrollState = False
End If
End If
Label_Congruation.Left = nScrollWidth
''以下为8秒钟内使“停止"按钮有效
If nEnableSecond <= 49 Then
If m_bIsStart = True Then
nEnableSecond =nEnableSecond + 1
End If
Else
If m_bIsStart = True Then
Command_Start_Stop.Enabled = True
nEnableSecond = 0
End If
End If
End Sub
''动态定义数组
Private Sub ReDimNameArray()
Dim nMaxIndex As Integer
Dim strMaxIndex As String
Dim nIndex As Integer
Dim bIsBegin As Boolean
bIsBegin = False
nIndex = 0
Open App.Path + “\name.txt" For Input As #1 ''读文件
Do Until EOF(1)
If bIsBegin = False Then
Line Input #1, strMaxIndex
nMaxIndex = Val(strMaxIndex)
MAX_INDEX = nMaxIndex - 1
ReDim m_strNameArray(0 To nMaxIndex - 1)
bIsBegin = True
Else
Line Input #1, m_strNameArray(nIndex).strName
m_strNameArray(nIndex).bIsSelect = False
nIndex = nIndex + 1
End If
Loop
''以下为打乱人员顺序10次
Dim i As Integer
Dim j As Integer
Dim Temp As String
Dim nRandomNum As Integer
For j = 0 To 10
For i = 0 To nMaxIndex - 1
nRandomNum = ((nMaxIndex - 1) × Rnd) ''利用Rnd函数
Temp = m_strNameArray(i).strName
m_strNameArray(i).strName = m_strNameArray(nRandomNum).strName
m_strNameArray(nRandomNum).strName = Temp
Next i
Next j
End Sub
Private Sub Init() ''读取INI文件
Dim X As Long
Dim lpFileName
Dim Temp As String ×