您好,欢迎来到五一七教育网。
搜索
您的当前位置:首页显示隐藏Excel VBA窗体标题栏

显示隐藏Excel VBA窗体标题栏

来源:五一七教育网
Dim hMain As LongDim tStr As String

Private Function TitleBar(ByVal bState As Boolean) Dim lStyle As Long

Dim tR As excelba.RECT GetWindowRect hMain, tR

lStyle = GetWindowLong(hMain, GWL_STYLE) If (bState) Then Me.Caption = tStr

lStyle = lStyle Or WS_SYSMENU lStyle = lStyle Or WS_CAPTION Else

Me.Caption = \"\"

lStyle = lStyle And Not WS_SYSMENU lStyle = lStyle And Not WS_CAPTION End If

SetWindowLong hMain, GWL_STYLE, lStyle

SetWindowPos hMain, 0, tR.Left, tR.Top, tR.Right - tR.Left, tR.Bottom - tR.Top, SWP_NOREPOSITIONEnd Function

Private Sub CheckBox1_Click()

If CheckBox1.Value = True Then TitleBar True

CheckBox1.Caption = \"单击隐藏标题\" Else

TitleBar False

CheckBox1.Caption = \"单击显示标题\" End IfEnd Sub

Private Sub UserForm_Initialize()

hMain = FindWindow(vbNullString, Me.Caption) tStr = Me.Caption

CheckBox1.Caption = \"单击隐藏标题\"End Sub

ITION Or SWP_NOZORDER Or SWP_FRAMECHANGED

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 517ttc.cn 版权所有 赣ICP备2024042791号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务