求教vba大神:我在制作好一个窗体后(这时候窗口有标题和一个关闭按钮)想把最小化按钮显示出来并能用
求教vba大神:我在制作好一个窗体后(这时候窗口有标题和一个关闭按钮)想把最小化按钮显示出来并能用,而关闭按钮让他失效变灰色,窗体的标题栏的样子是图片上那样的,(边框角是...
求教vba大神:我在制作好一个窗体后(这时候窗口有标题和一个关闭按钮)想把最小化按钮显示出来并能用,而关闭按钮让他失效变灰色,窗体的标题栏的样子是图片上那样的,(边框角是直角的),怎么实现啊。
展开
1个回答
展开全部
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const GWL_STYLE = (-16)
Private Sub UserForm_Initialize()
Dim hWndForm As Long
Dim IStyle As Long
hWndForm = FindWindow("ThunderDFrame", Me.Caption)
IStyle = GetWindowLong(hWndForm, GWL_STYLE)
IStyle = IStyle Or WS_THICKFRAME
IStyle = IStyle Or WS_MINIMIZEBOX
SetWindowLong hWndForm, GWL_STYLE, IStyle
End Sub
把这段代码加到窗体里
更多追问追答
追问
谢谢
测试的结果没有达到我的要求哦
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询