📄 f.frm
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form f
Caption = "西区邮电局2006联欢会抽奖-全局干部职工 人均有机会中奖"
ClientHeight = 10860
ClientLeft = 60
ClientTop = 600
ClientWidth = 14655
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0FF&
LinkTopic = "Form1"
Picture = "F.frx":0000
ScaleHeight = 10860
ScaleWidth = 14655
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List2
Height = 5760
Left = 2400
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.ListBox List1
Height = 5760
Left = 600
TabIndex = 3
Top = 1560
Width = 1215
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 8055
Left = 9720
TabIndex = 0
Top = 1320
Width = 3855
_ExtentX = 6800
_ExtentY = 14208
_Version = 393217
BackColor = 12648384
ScrollBars = 3
Appearance = 0
RightMargin = 1
TextRTF = $"F.frx":2AD6E
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "幼圆"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSForms.CommandButton CommandButton4
Height = 735
Left = 7920
TabIndex = 16
Top = 9360
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "纪念奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.CommandButton CommandButton3
Height = 735
Left = 6000
TabIndex = 15
Top = 9360
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "纪念奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.CommandButton CommandButton2
Height = 735
Left = 4080
TabIndex = 14
Top = 9360
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "纪念奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.CommandButton CommandButton1
Height = 735
Left = 2040
TabIndex = 13
Top = 9360
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "纪念奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.CommandButton cmd4
Height = 735
Left = 0
TabIndex = 12
Top = 9360
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "纪念奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.Label Labelup
Height = 1215
Left = 1680
TabIndex = 11
Top = 120
Width = 11775
ForeColor = 255
VariousPropertyBits= 8388627
Caption = "西区邮电局2007年联欢会祝您中奖"
Size = "20770;2143"
FontName = "隶书"
FontEffects = 1073741827
FontHeight = 720
FontCharSet = 134
FontPitchAndFamily= 34
FontWeight = 700
End
Begin MSForms.TextBox TextBox1
Height = 8055
Left = 5280
TabIndex = 10
Top = 120
Visible = 0 'False
Width = 3975
VariousPropertyBits= -1400879085
BackColor = 12648384
ForeColor = 65535
BorderStyle = 1
ScrollBars = 3
Size = "7011;14208"
SpecialEffect = 0
FontName = "幼圆"
FontEffects = 1073741825
FontHeight = 360
FontCharSet = 134
FontPitchAndFamily= 34
FontWeight = 700
End
Begin MSForms.CommandButton cmd3
Height = 735
Left = 6000
TabIndex = 9
Top = 8400
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "三等奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.CommandButton cmd2
Height = 735
Left = 3960
TabIndex = 8
Top = 8400
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "二等奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.CommandButton cmd1
Height = 735
Left = 2040
TabIndex = 7
Top = 8400
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "一等奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.CommandButton cmd0
Height = 735
Left = 3960
TabIndex = 6
Top = 7440
Width = 1695
ForeColor = 65280
VariousPropertyBits= 19
Caption = "特等奖"
Size = "2990;1296"
FontName = "隶书"
FontEffects = 1073741825
FontHeight = 480
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
FontWeight = 700
End
Begin MSForms.Label Labeldown
Height = 1215
Left = 1755
TabIndex = 5
Top = 195
Width = 11775
ForeColor = 4210752
VariousPropertyBits= 8388627
Caption = "西区邮电局2007年联欢会祝您中奖"
Size = "20770;2143"
FontName = "隶书"
FontEffects = 1073741827
FontHeight = 720
FontCharSet = 134
FontPitchAndFamily= 34
FontWeight = 700
End
Begin VB.Label Label2
BackColor = &H000000FF&
Caption = "0"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 495
Left = 12600
TabIndex = 2
Top = 9600
Width = 1095
End
Begin VB.Label Label1
BackColor = &H000000FF&
Caption = "已中奖人数:"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FFFF&
Height = 495
Left = 9840
TabIndex = 1
Top = 9600
Width = 2775
End
End
Attribute VB_Name = "f"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd0_Click()
G.Show 1
ss "--- 特等奖:名单 ---"
prize 1
ss String(5, "-") & " 1 人 " & String(5, "-")
cmd0.Enabled = False
End Sub
Private Sub cmd1_Click()
G.Show 1
ss "--- 一等奖:名单---"
prize 2
ss String(5, "-") & " 2 人 " & String(5, "-")
cmd1.Enabled = False
End Sub
Private Sub cmd2_Click()
G.Show 1
ss "--- 二等奖:名单 ---"
prize 6
ss String(5, "-") & " 6人 " & String(5, "-")
cmd2.Enabled = False
End Sub
Private Sub cmd3_Click()
G.Show 1
ss "--- 三等奖:名单 ---"
prize 10
ss String(5, "-") & " 10 人 " & String(5, "-")
cmd3.Enabled = False
End Sub
Private Sub cmd4_Click()
Dim I As Integer
GoTo First
ss "--- 纪念奖:名单 ---"
For I = 1 To 5
MsgBox "第 " & I & " 批", , "按任一键"
ss String(4, " - ") & " 第 " & I & " 段" & String(4, " - ")
ss String(18, "-")
G.Show 1
prize 10
ss String(18, "-")
Next
ss String(5, "-") & " 50 人 " & String(5, "-")
cmd4.Enabled = False
Exit Sub
First:
G.Show 1
ss "--- 纪念奖:名单 1 ---"
prize 10
ss String(5, "-") & " 10 人 " & String(5, "-")
cmd4.Enabled = False
End Sub
Private Sub cmdSaveToDisk_Click()
RichTextBox1.SaveFile App.Path & "\" & "中奖.txt", 1
MsgBox "中奖结果已保存!", vbInformation
End Sub
Function isRepeat(No As Long)
Dim reSult As Boolean
isRepeat = False
Dim I As Long
'MsgBox "E"
For I = 1 To Seq
'MsgBox "i=" & i & " seq=" & Seq
If Order(I) = No Then
reSult = True
isRepeat = reSult
Exit Function
Else
reSult = False
isRepeat = False
End If
'MsgBox reSult
Next
End Function
Private Sub CommandButton1_Click()
G.Show 1
ss "--- 纪念奖:名单 2 ---"
prize 10
ss String(5, "-") & " 10 人 " & String(5, "-")
CommandButton1.Enabled = False
End Sub
Private Sub CommandButton2_Click()
G.Show 1
ss "--- 纪念奖:名单 3 ---"
prize 10
ss String(5, "-") & " 10 人 " & String(5, "-")
CommandButton2.Enabled = False
End Sub
Private Sub CommandButton3_Click()
G.Show 1
ss "--- 纪念奖:名单 4 ---"
prize 10
ss String(5, "-") & " 10 人 " & String(5, "-")
CommandButton3.Enabled = False
End Sub
Private Sub CommandButton4_Click()
G.Show 1
ss "--- 纪念奖:名单 5 ---"
prize 10
ss String(5, "-") & " 10 人 " & String(5, "-")
CommandButton4.Enabled = False
End Sub
Private Sub Form_Load()
Dim lines As Integer
lines = 0
Open "cjk.txt" For Input As #1 ' 打开输出文件。
Do While Not EOF(1) ' 循环至文件尾。
lines = lines + 1
Input #1, text(lines) ' 将数据读入两个变量。
Loop
Close #1 ' 关闭文件。
'MsgBox "总人数" & lines
N_Rows = lines '总人数赋值
prizeCount = 1
ReDim Order(N_Rows)
For I = 1 To N_Rows
Order(I) = 0
Next
Seq = 0
Me.Caption = "西区邮电局2007春节联欢会-全局共" & N_Rows & "人,机会均等,祝您中奖!"
Call AutoSwitchLine(RichTextBox1, False)
'Call AutoSwitchLine(TextBox1, False)
Call TextTrans(RichTextBox1)
If Command() = "" Then
List1.Visible = False
List2.Visible = False
Else
End If
Me.WindowState = vbMaximized
End Sub
Function GetNo()
Dim tempNo As Long
tempNo = genNo()
While isRepeat(tempNo)
tempNo = genNo
'MsgBox "发现重复"
Wend
GetNo = tempNo
End Function
Function ss(cs As String)
RichTextBox1.text = RichTextBox1.text & cs & vbCrLf
Label2 = Seq
RichTextBox1.SelStart = Len(RichTextBox1.text)
'RichTextBox1.SelLength = 1
TextBox1.text = RichTextBox1.text
End Function
Function prize(prizeCount As Integer)
Dim I As Integer
For I = 1 To prizeCount
Seq = Seq + 1
Order(Seq) = GetNo()
ss text(Order(Seq))
List1.AddItem Order(Seq)
Call a_z
Next
End Function
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("真的要退出吗?", vbYesNo + vbQuestion) = vbYes Then
'Call a_z
If MsgBox(" 中奖文件 , 是否存盘?", vbYesNo + vbQuestion) = vbYes Then
Call cmdSaveToDisk_Click
End If
Else
Cancel = True
End If
End Sub
Private Sub a_z()
Dim I As Integer
Dim j As Integer
Dim z As Integer
'MsgBox Seq
For I = 1 To Seq
For j = I + 1 To Seq
If Order(I) > Order(j) Then z = Order(I): Order(I) = Order(j): Order(j) = z
Next
Next
List2.Clear
For I = 1 To Seq
List2.AddItem Order(I)
Next
End Sub
Private Sub Label4_Click()
End Sub
Private Sub List1_Click()
Call a_z
End Sub
Private Sub List2_Click()
Call a_z
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -