无标题栏和边框的窗体

无标题栏和边框的窗体


2024年7月2日发(作者:)

技巧1 无标题栏和边框的窗体

API函数。

,双击窗体,在其代码窗口中输入下面

如果希望制作无标题栏和边框的窗体,那么可以使用

在VBE窗口中单击菜单“插入”→“用户窗体”

的代码:

#001 Private

As Long

#002 Private Declare Function

Declare Function DrawMenuBar Lib "user32" (ByVal Hwnd As Long)

GetWindowLong Lib "user32" Alias

"GetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long) As Long

#003 Private Declare Function SetWindowLong Lib "user32" Alias

"SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As

Long) As Long

#004 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"

(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

#005 Private Const GWL_STYLE As Long = (-16)

#006 Private Const GWL_EXSTYLE = (-20)

#007 Private Const WS_CAPTION As Long = &HC00000

#008 Private Const WS_EX_DLGMODALFRAME = &H1&

#009 Private Sub UserForm_Initialize()

#010 Dim IStyle As Long

#011 Dim Hwnd As Long

#012 If Val(n) < 9 Then

#013 Hwnd = FindWindow("ThunderXFrame", n)

#014 Else

#015 Hwnd = FindWindow("ThunderDFrame", n)

#016 End If

#017 IStyle = GetWindowLong(Hwnd, GWL_STYLE)

#018 IStyle = IStyle And Not WS_CAPTION


发布者:admin,转转请注明出处:http://www.yc00.com/web/1719890802a2759091.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信