2个回答
展开全部
我也遇到同样问题。问过很多人,给的都不一样。这个最简单了。
代码如下:
将窗体的BorderStyle 属性设为0
ShowInTaskbar属性设为True
在窗体中添加一个按钮,以下是完整代码
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 Const GWL_STYLE = (-16)
Private Const WS_SYSMENU =&H80000
Private Const WS_MINIMIZEBOX =&H20000
Private Const WS_MAXIMIZEBOX =&H10000
Private Sub Command1_Click()
Me.WindowState = 1
End Sub
Private Sub Form_Load()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lStyle = lStyle Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX Or WS_SYSMENU
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
End Sub
详细请采纳!
代码如下:
将窗体的BorderStyle 属性设为0
ShowInTaskbar属性设为True
在窗体中添加一个按钮,以下是完整代码
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 Const GWL_STYLE = (-16)
Private Const WS_SYSMENU =&H80000
Private Const WS_MINIMIZEBOX =&H20000
Private Const WS_MAXIMIZEBOX =&H10000
Private Sub Command1_Click()
Me.WindowState = 1
End Sub
Private Sub Form_Load()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lStyle = lStyle Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX Or WS_SYSMENU
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
End Sub
详细请采纳!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询