📄 configform.frm
字号:
VERSION 5.00
Begin VB.Form ConfigForm
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "系统配置"
ClientHeight = 3180
ClientLeft = 45
ClientTop = 330
ClientWidth = 6240
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3180
ScaleWidth = 6240
ShowInTaskbar = 0 'False
Begin VB.CommandButton CancelExit
Cancel = -1 'True
Caption = "取消(&C)"
Height = 375
Left = 4860
TabIndex = 6
Top = 1155
Width = 1185
End
Begin VB.CommandButton OkSave
Caption = "保存(&S)"
Default = -1 'True
Height = 375
Left = 4860
TabIndex = 5
Top = 750
Width = 1185
End
Begin VB.Frame Frame3
Caption = "系统桌面"
Height = 1200
Left = 2085
TabIndex = 11
Top = 1665
Width = 3945
Begin VB.CommandButton Command1
Caption = "选择图片"
Height = 390
Left = 210
TabIndex = 4
Top = 720
Width = 1080
End
Begin VB.TextBox Text2
Height = 300
Left = 210
MaxLength = 100
TabIndex = 3
Top = 345
Width = 3525
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "桌面图片文件路径及名称"
ForeColor = &H00000080&
Height = 180
Left = 1665
TabIndex = 12
Top = 825
Width = 1980
End
End
Begin VB.Frame Frame2
Caption = "过期展会"
Height = 1200
Left = 180
TabIndex = 10
Top = 1665
Width = 1830
Begin VB.OptionButton Option2
Caption = "过期删除"
Height = 300
Left = 420
TabIndex = 1
Top = 390
Width = 1095
End
Begin VB.OptionButton Option1
Caption = "继续保留"
Height = 255
Left = 420
TabIndex = 2
Top = 750
Value = -1 'True
Width = 1185
End
End
Begin VB.Frame Frame1
Caption = "公司名称"
Height = 900
Left = 180
TabIndex = 9
Top = 660
Width = 4440
Begin VB.TextBox Text1
Height = 285
Left = 180
MaxLength = 100
TabIndex = 0
Top = 375
Width = 4140
End
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
BackColor = &H00808000&
Height = 420
Left = -15
ScaleHeight = 360
ScaleWidth = 6210
TabIndex = 7
Top = -15
Width = 6270
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "为 了 更 好 的 管 理 好 展 会 , 请 认 真 配 置 系 统 。"
ForeColor = &H00FFFFFF&
Height = 180
Left = 585
TabIndex = 8
Top = 90
Width = 5040
End
End
End
Attribute VB_Name = "ConfigForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim ConfigFile As String
Dim PhotoFile As String
Private Sub CancelExit_Click()
Unload Me
End Sub
Private Sub Command1_Click()
ConfigForm.MousePointer = 11
Load SelectFile
SelectFile.Show 1
ConfigForm.MousePointer = 0
End Sub
Private Sub Form_Load()
ConfigForm.Left = Menu.Width
ConfigForm.Top = 0
ConfigFile = Browser + "Config.ysl"
If Dir(ConfigFile) = "" Then
MsgBox "配置文件 Config.ysl 没有找到,请与管理员联系!", vbOKOnly + 16, "配置出错"
Text1.Enabled = False
Text2.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
OkSave.Enabled = False
Command1.Enabled = False
Exit Sub
End If
Dim ConfigCol As New Collection
Dim InNum As Integer, LineStr As String
InNum = FreeFile
Open ConfigFile For Input As #InNum
While Not EOF(InNum)
Line Input #InNum, LineStr
ConfigCol.Add LineStr
Wend
Close #InNum
If ConfigCol.Count < 3 Or ConfigCol.Count > 3 Then
MsgBox "配置文件遭破坏,请重新配置该系统。", vbOKOnly + 16, "文件破坏"
Exit Sub
End If
Text1.Text = ConfigCol.Item(1)
Text2.Text = ConfigCol.Item(3)
If ConfigCol.Item(2) = "继续保留" Then
Option1.Value = True
Else
Option2.Value = True
End If
PhotoFile = Text2.Text
End Sub
Private Sub OkSave_Click()
InNum = FreeFile
On Error Resume Next
If Trim(Text1.Text) = "" Then
Text1.Text = "东宝化学有限公司"
End If
If Dir(Trim(Text2.Text)) = "" Then
MsgBox "配置的图片文件不存在,系统将以缺省的图片放置!", vbOKOnly + 48, "文件没有找到"
Text2.Text = PhotoFile
End If
On Error GoTo Novalib
ConfigForm.MousePointer = 11
MDIForm1.Picture = LoadPicture(Text2.Text)
On Error GoTo 0
Open ConfigFile For Output As #InNum
LineStr = Text1.Text
Print #InNum, LineStr
If Option1.Value = True Then
LineStr = "继续保留"
Else
LineStr = "过期删除"
End If
Print #InNum, LineStr
LineStr = Text2.Text
Print #InNum, LineStr
Close #InNum
'Application set value
MDIForm1.Caption = Text1.Text + "-展会处理系统"
MDIForm1.StatusBar.Panels.Item(6).Text = "制作单位:" + Text1.Text
MDIForm1.StatusBar.Panels.Item(6).ToolTipText = "欢迎使用本软件"
ConfigForm.MousePointer = 0
Unload Me
Exit Sub
Novalib:
MsgBox "无效的图片文件,支持 BMP、WMF、ICO、JPG、GIF、" & Chr(10) & Chr(13) & Chr(13) & "EMF、RLE 文件类型!系统将以缺省的图片安装!", vbOKOnly + 32, "图片错误"
MDIForm1.Picture = LoadPicture(PhotoFile)
Text2.SetFocus
ConfigForm.MousePointer = 0
Exit Sub
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text2_GotFocus()
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -