📄 main.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form Frmmain
AutoRedraw = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "给窗体换肤"
ClientHeight = 3015
ClientLeft = 5880
ClientTop = 4470
ClientWidth = 4290
ClipControls = 0 'False
ControlBox = 0 'False
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "main.frx":0000
KeyPreview = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
NegotiateMenus = 0 'False
OLEDropMode = 1 'Manual
ScaleHeight = 201
ScaleMode = 3 'Pixel
ScaleWidth = 286
Begin MSComDlg.CommonDialog Cdl1
Left = 3720
Top = 2520
_ExtentX = 847
_ExtentY = 847
_Version = 393216
Filter = "(所有图片文件)|*.bmp;*.gif;*.jpg|*.bmp|*.bmp|*.gif|*.gif|*.jpg|*.jpg"
End
Begin MSForms.TextBox TextBox1
Height = 2055
Left = 120
TabIndex = 3
Top = 360
Width = 3855
VariousPropertyBits= -1400879085
ForeColor = 0
Size = "6800;3625"
Value = $"main.frx":08CA
FontName = "宋体"
FontHeight = 210
FontCharSet = 134
FontPitchAndFamily= 34
End
Begin MSForms.Label Label1
Height = 255
Left = 120
TabIndex = 2
Top = 0
Width = 4095
VariousPropertyBits= 8388627
Caption = "一个可以换肤的窗体"
Size = "7223;450"
FontName = "宋体"
FontHeight = 240
FontCharSet = 134
FontPitchAndFamily= 34
End
Begin MSForms.CommandButton CmdExit
Height = 375
Left = 2160
TabIndex = 1
Top = 2520
Width = 1575
ForeColor = 192
VariousPropertyBits= 19
Caption = "退出程序"
Size = "2778;661"
FontName = "宋体"
FontHeight = 210
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
End
Begin MSForms.CommandButton CmdSel
Height = 375
Left = 360
TabIndex = 0
Top = 2520
Width = 1455
ForeColor = 192
VariousPropertyBits= 19
Caption = "选择背景图片"
Size = "2566;661"
FontName = "宋体"
FontHeight = 210
FontCharSet = 134
FontPitchAndFamily= 34
ParagraphAlign = 3
End
End
Attribute VB_Name = "Frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdExit_Click()
Unload Me
End Sub
'也可点击“选择背景图片”按钮,在程序运行过程中更换背景图片
Private Sub CmdSel_Click()
'打开选择文件对话框
Cdl1.ShowOpen
'选中的图片文件的路径赋值给BackPicture变量(全局变量,在模块中定义)
BackPicture = Cdl1.FileName
'换肤
ShowBackGround Frmmain
End Sub
'窗体加载时自动从应用程序所在的目录下寻找default.bmp文件,并把它设置为窗体背景
'我们可以用其它图片替换此文件以为应用程序换上不同的皮肤
Private Sub Form_Load()
'取得背景图片的完整路径
BackPicture = App.Path + "\default.JPG"
'ShowBackGround子过程(在模块中定义),为窗体设置背景
ShowBackGround Frmmain
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -