Excel vba 窗体编辑中,有时候需要做全屏幕效果,这是个很好的想法,我们用几行简单代码即可实现。
全屏效果
全屏代码
- 下面代码放到VBE编辑器通用申明里。
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Const SM_CXSCREEN As Long = 0
Const SM_CYSCREEN As Long = 1
- 在UserForm_Initialize过程事件中如下代码:
With Me
.Height = GetSystemMetrics(SM_CYSCREEN) * 0.75
.Width = GetSystemMetrics(SM_CXSCREEN) * 0.75
.Left = 0
.Top = 0
End With
- 下面是立体文字代码,也写到UserForm_Initialize过程事件中。
With Me.Label1
.Top = 100
.Left = 0
.Height = .Parent.Height
.Width = .Parent.Width
.Font.Size = 200
.Font.Name = "微软雅黑"
.Caption = "全屏效果"
.ForeColor = RGB(201, 122, 21)
.TextAlign = fmTextAlignCenter
.BackStyle = fmBackStyleTransparents
End With
With Me.Label2
.Top = 102
.Left = 15
.Height = .Parent.Height
.Width = .Parent.Width
.Font.Size = 200
.Font.Name = "微软雅黑"
.Caption = "全屏效果"
.ForeColor = RGB(211, 152, 211)
.TextAlign = fmTextAlignCenter
.BackStyle = fmBackStyleTransparent
End With
With Me.Label3
.Top = 0
.Left = 0
.Height = 50
.Width = 100
.Font.Size = 20
.Font.Name = "微软雅黑"
.Caption = "头条.江觅"
.ForeColor = RGB(211, 212, 211)
.TextAlign = fmTextAlignCenter
.BackStyle = fmBackStyleTransparent
End With
保存按F5运行,全屏效果还是不错的。马上收藏,备用。
好了,这篇文章的内容营销圈就和大家分享到这里,如果大家网络推广引流创业感兴趣,可以添加微信:Sum8338 备注:营销圈引流学习,我拉你进直播课程学习群,每周135晚上都是有实战干货的推广引流技术课程免费分享!
好了,这篇文章的内容营销圈就和大家分享到这里,如果大家对网络推广引流和网络创业项目感兴趣,可以添加微信:Sum8338 备注:营销圈引流学习,我拉你进直播课程学习群,每周135晚上都是有实战的推广引流技术和网络创业项目课程分享,当然是免费学!
版权声明:本站部分文章来源互联网用户自发投稿,主要目的在于分享信息,版权归原作者所有,不承担相关法律责任。如有侵权请联系我们反馈邮箱yingxiaoo@foxmail.com,我们将在7个工作日内进行处理,如若转载,请注明本文地址:https://www.yingxiaoo.com/189375.html