📄 frmbackset.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form frmSysSet
Caption = "背景设置"
ClientHeight = 4545
ClientLeft = 60
ClientTop = 345
ClientWidth = 6090
Icon = "frmBackSet.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4545
ScaleWidth = 6090
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame3
Caption = "背景图片"
Height = 2655
Left = 120
TabIndex = 8
Top = 1380
Width = 5895
Begin VB.CommandButton cmdBrowse
Caption = "浏览(&B)"
Height = 375
Left = 2160
TabIndex = 11
ToolTipText = "选择自定义图片"
Top = 600
Width = 1095
End
Begin VB.PictureBox PicBack
Height = 2055
Left = 3360
ScaleHeight = 1995
ScaleWidth = 2235
TabIndex = 10
Top = 480
Width = 2295
End
Begin VB.ListBox LstImage
Height = 2040
ItemData = "frmBackSet.frx":0442
Left = 240
List = "frmBackSet.frx":0458
TabIndex = 9
Top = 480
Width = 1815
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "图片预览"
Height = 180
Left = 3360
TabIndex = 13
Top = 240
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请选择图片"
Height = 180
Left = 240
TabIndex = 12
Top = 240
Width = 900
End
End
Begin VB.Frame Frame2
Caption = "背景颜色"
Height = 1095
Left = 2160
TabIndex = 5
Top = 120
Width = 3855
Begin VB.Label LabColor
BorderStyle = 1 'Fixed Single
Height = 375
Left = 1320
TabIndex = 7
ToolTipText = "设置程序的背景色"
Top = 420
Width = 2295
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "背景颜色"
Height = 180
Left = 240
TabIndex = 6
Top = 517
Width = 720
End
End
Begin VB.Frame Frame1
Caption = "背景样式"
Height = 1095
Left = 120
TabIndex = 2
Top = 120
Width = 1695
Begin VB.OptionButton OptColor
Caption = "背景颜色"
Height = 255
Left = 240
TabIndex = 4
ToolTipText = "选择此项时使用背景色"
Top = 720
Width = 1215
End
Begin VB.OptionButton OptImage
Caption = "背景图片"
Height = 255
Left = 240
TabIndex = 3
Top = 300
Value = -1 'True
Width = 1215
End
End
Begin VB.CommandButton cmdCancel
Caption = "取消(&C)"
Height = 375
Left = 4800
TabIndex = 1
ToolTipText = "取消所有设置"
Top = 4140
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "确定(&O)"
Height = 375
Left = 3360
TabIndex = 0
ToolTipText = "使设置生效"
Top = 4140
Width = 1095
End
Begin MSComDlg.CommonDialog ComDlg
Left = 60
Top = 4080
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
End
Attribute VB_Name = "frmSysSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdBrowse_Click()
ComDlg.Filter = "ICO File(*.ico,*.cur)|*.ico,*.cur|Bitmap (*.bmp,*.dib)|*.bmp,*.dib|JPEG(*.jpg)|*.jpg|GIF(*.gif)|*.gif"
ComDlg.FilterIndex = 3
ComDlg.ShowOpen
ImagePath = ComDlg.FileName
PicBack.Picture = LoadPicture(ImagePath)
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim FileNo As Long
If OptColor.Value Then
frmMain.Picture = LoadPicture()
frmMain.BackColor = LabColor.BackColor
Else
frmMain.Picture = PicBack.Picture
End If
FileNo = FreeFile
Open App.Path & "\Config.sys" For Output As #FileNo
If OptColor.Value = True Then
Print #FileNo, "Color"
Print #FileNo, LabColor.BackColor
Else
Print #FileNo, "Image"
Print #FileNo, ImagePath
End If
Close #FileNo
Unload Me
End Sub
Private Sub Form_Load()
LabColor.BackColor = frmMain.BackColor
PicBack.Picture = frmMain.Picture
End Sub
Private Sub labColor_Click()
ComDlg.ShowColor
LabColor.BackColor = ComDlg.Color
End Sub
Private Sub LstImage_Click()
Select Case LstImage.Text
Case "图片1"
ImagePath = App.Path & "\ico\01.jpg"
Case "图片2"
ImagePath = App.Path & "\ico\02.jpg"
Case "图片3"
ImagePath = App.Path & "\ico\03.jpg"
Case "图片4"
ImagePath = App.Path & "\ico\04.jpg"
Case "图片5"
ImagePath = App.Path & "\ico\05.jpg"
Case "图片6"
ImagePath = App.Path & "\ico\06.jpg"
End Select
PicBack.Picture = LoadPicture(ImagePath)
PicBack.Refresh '更新
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -