Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim c As Control
For Each c In Me.Controls
If TypeOf (c) Is MdiClient Then
With CType(c, MdiClient)
'----====: 此处,已得到MDI客户窗口:c
'----====: 下面尝试去掉滚动条
Dim style As Int32 = GetWindowLong(.Handle, -16)
style = style And &HFFCFFFFF
SetWindowLong(.Handle, -16, style)
SetWindowPos(.Handle, IntPtr.Zero, 0, 0, 0, 0, &H37)
End With
End If
Next
End Sub
--==========================---
用到的函数主要有以下几个:
Declare Function GetWindowLong Lib "user32.dll" Alias _
"GetWindowLongW" (ByVal hWnd As IntPtr, ByVal nIndex As Integer) As Int32
Declare Function SetWindowLong Lib "user32.dll" Alias _
"SetWindowLongW" (ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal nValue As Int32) As Int32
Declare Function SetWindowPos Lib "user32.dll" Alias _
"SetWindowPos" (ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, _
ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, _
ByVal uFlags As Int32) As Boolean
Declare Function ShowScrollBar Lib "user32.dll" Alias _
"ShowScrollBar" (ByVal hWnd As IntPtr, ByVal wBar As Integer, ByVal bShow As Boolean) As Boolean