📄 configfrm.frm
字号:
VERSION 5.00
Begin VB.Form ConfigFrm
BorderStyle = 3 'Fixed Dialog
Caption = "通用抽奖软件"
ClientHeight = 4470
ClientLeft = 45
ClientTop = 330
ClientWidth = 6540
Icon = "ConfigFrm.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 298
ScaleMode = 3 'Pixel
ScaleWidth = 436
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton Command3
Caption = "使用说明"
Height = 375
Left = 2184
TabIndex = 23
Top = 960
Width = 915
End
Begin VB.TextBox txtInfo
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 405
Left = 3120
TabIndex = 20
Top = 2640
Width = 2895
End
Begin VB.CommandButton Command2
Caption = "情感故事会"
Height = 375
Left = 3156
TabIndex = 19
Top = 960
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "网际播音"
Height = 375
Left = 4308
TabIndex = 18
Top = 960
Width = 915
End
Begin VB.CommandButton CmdStart
Caption = "进入.."
Height = 375
Left = 240
TabIndex = 17
Top = 960
Width = 915
End
Begin VB.CommandButton CmdConfig
Caption = "配置>>"
Height = 375
Left = 1212
TabIndex = 16
Top = 960
Width = 915
End
Begin VB.CommandButton CmdExit
Caption = "退出"
Height = 375
Left = 5280
TabIndex = 15
Top = 960
Width = 915
End
Begin VB.CommandButton CmdConfirm
Caption = "保存(&S)"
Height = 375
Left = 4560
TabIndex = 13
Top = 3600
Width = 1215
End
Begin VB.Frame Frame1
Caption = "参数配置"
Height = 2415
Left = 120
TabIndex = 0
Top = 1800
Width = 6255
Begin VB.TextBox txtName
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 405
Left = 960
TabIndex = 11
Top = 360
Width = 5055
End
Begin VB.TextBox txtSpecial
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 405
Left = 960
TabIndex = 9
Top = 1320
Width = 855
End
Begin VB.TextBox txtThird
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 405
Left = 3000
TabIndex = 7
Top = 1800
Width = 735
End
Begin VB.TextBox txtSecond
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 405
Left = 960
TabIndex = 5
Top = 1800
Width = 855
End
Begin VB.TextBox txtFirst
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 405
Left = 3000
TabIndex = 3
Top = 1320
Width = 735
End
Begin VB.TextBox txtAll
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 405
Left = 960
TabIndex = 2
Top = 840
Width = 855
End
Begin VB.Label Label9
Caption = "中奖祝福:"
Height = 255
Left = 2160
TabIndex = 22
Top = 960
Width = 975
End
Begin VB.Label Label6
Caption = "活动名称:"
Height = 255
Left = 120
TabIndex = 12
Top = 480
Width = 975
End
Begin VB.Label Label5
Caption = "特等奖: 名"
Height = 255
Left = 120
TabIndex = 10
Top = 1440
Width = 2055
End
Begin VB.Label Label4
Caption = "三等奖: 名"
Height = 255
Left = 2160
TabIndex = 8
Top = 1920
Width = 2055
End
Begin VB.Label Label2
Caption = "二等奖: 名"
Height = 255
Left = 120
TabIndex = 6
Top = 1920
Width = 2055
End
Begin VB.Label Label3
Caption = "一等奖: 名"
Height = 255
Left = 2160
TabIndex = 4
Top = 1440
Width = 2055
End
Begin VB.Label Label1
Caption = "总票数: 人"
Height = 255
Left = 120
TabIndex = 1
Top = 960
Width = 2775
End
End
Begin VB.Label Label8
Caption = "活动名称:"
Height = 255
Left = 1920
TabIndex = 21
Top = 2880
Width = 975
End
Begin VB.Label Label7
Caption = $"ConfigFrm.frx":72FA
Height = 735
Left = 240
TabIndex = 14
Top = 120
Width = 6015
End
End
Attribute VB_Name = "ConfigFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim objProfile As New Profile
Private Sub CmdConfig_Click()
If CmdConfig.Caption = "配置>>" Then
Me.Height = 4800
CmdConfig.Caption = "配置<<"
Else
Me.Height = 2200
CmdConfig.Caption = "配置>>"
End If
End Sub
Private Sub saveConfig()
If txtName.Text = "" Then
MsgBox "请输入活动名称!"
Exit Sub
End If
If txtInfo.Text = "" Then
MsgBox "请输入中奖祝福,即中奖后上方显示的信息!"
Exit Sub
End If
If txtAll.Text = "" Then
MsgBox "请输入总票数!"
Exit Sub
Else
If Not IsNumeric(txtFirst.Text) Then
MsgBox "总票数必须输入数字"
End If
End If
If txtFirst.Text = "" Then
MsgBox "请输入一等奖数量!"
Exit Sub
Else
If Not IsNumeric(txtFirst.Text) Then
MsgBox "一等奖数量必须输入数字"
End If
End If
If txtSecond.Text = "" Then
MsgBox "请输入二等奖数量!"
Exit Sub
Else
If Not IsNumeric(txtSecond.Text) Then
MsgBox "二等奖数量必须输入数字"
End If
End If
If txtThird.Text = "" Then
MsgBox "请输入三等奖数量!"
Exit Sub
Else
If Not IsNumeric(txtThird.Text) Then
MsgBox "三等奖数量必须输入数字"
End If
End If
If txtSpecial.Text = "" Then
MsgBox "请输入特等奖数量!"
Exit Sub
Else
If Not IsNumeric(txtSpecial.Text) Then
MsgBox "特等奖数量必须输入数字"
End If
End If
actionName = txtName.Text
actionInfo = txtInfo.Text
firstCount = toNum(txtFirst.Text)
secondCount = toNum(txtSecond.Text)
thirdCount = toNum(txtThird.Text)
specialCount = toNum(txtSpecial.Text)
allCount = toNum(txtAll.Text)
With objProfile
.FileName = App.path + "\config.ini"
.SetValue "系统设置", "活动名称", actionName
.SetValue "系统设置", "总票数", allCount
.SetValue "系统设置", "特等奖数量", specialCount
.SetValue "系统设置", "一等奖数量", firstCount
.SetValue "系统设置", "二等奖数量", secondCount
.SetValue "系统设置", "三等奖数量", thirdCount
.SetValue "系统设置", "中奖祝福", actionInfo
End With
End Sub
Private Sub CmdConfirm_Click()
saveConfig
CmdConfig_Click
MsgBox "参数设置成功"
End Sub
Private Sub CmdExit_Click()
Unload Me
End Sub
Private Sub CmdStart_Click()
saveConfig
SelectFrm.Show 1
End Sub
Private Sub Command1_Click()
ShellExecute Me.hWnd, "open", "http://www.pinksofts.com/speak", "", "", SW_SHOW
End Sub
Private Sub Command2_Click()
ShellExecute Me.hWnd, "open", "http://www.pinksofts.com/", "", "", SW_SHOW
End Sub
Private Sub Command3_Click()
ShellExecute Me.hWnd, "open", "http://www.pinksofts.com/speak/lotto.htm", "", "", SW_SHOW
End Sub
Private Sub Form_Load()
Me.Height = 2200
Dim A As Integer, path As String, APPPATH As String
'获得当前路径8.3格式的短路径名
If Right(App.path, 1) = "\" Then path = App.path Else path = App.path & "\"
APPPATH = String$(165, 0)
A = GetShortPathName(path, APPPATH, 164)
APPPATH = Left(APPPATH, InStr(APPPATH, Chr(0)) - 1)
Res = mciSendString("play " & APPPATH & "images\music.mid from 3000 to 8000", Ret, 1024, 0)
'Me.Picture = LoadPicture(App.path & "/images/first.jpg")
With objProfile
.FileName = App.path + "\config.ini"
actionName = .GetValue("系统设置", "活动名称")
allCount = toNum(.GetValue("系统设置", "总票数"))
specialCount = toNum(.GetValue("系统设置", "特等奖数量"))
firstCount = toNum(.GetValue("系统设置", "一等奖数量"))
secondCount = toNum(.GetValue("系统设置", "二等奖数量"))
thirdCount = toNum(.GetValue("系统设置", "三等奖数量"))
actionInfo = .GetValue("系统设置", "中奖祝福")
End With
txtName.Text = actionName
txtInfo.Text = actionInfo
txtFirst.Text = firstCount
txtSecond.Text = secondCount
txtThird.Text = thirdCount
txtSpecial.Text = specialCount
txtAll.Text = allCount
End Sub
Function toNum(num As String) As Integer
Dim tmpNum As Integer
If IsNumeric(num) Then tmpNum = CInt(num) Else tmpNum = 1
toNum = tmpNum
End Function
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Res = mciSendString("close all", Ret, 1024, 0)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -