Correct me if I'm wrong, but to disable you can follow these attempts:
- Has some control inside the form that is extending the size of it, or is larger than the window itself.
- Change the property
AutoScroll
to False .
- Change the property
AutoScaleMode
to Dpi
.
- Move some controls to a location visible in the window.
Not resolved? I found this template in this file . Try the following:
1. Declare this function
<DllImport("user32.dll")> _
Private Shared Function ShowScrollBar(ByVal hWnd As IntPtr, ByVal wBar As Integer, ByVal bShow As Integer) As Integer
End Function
2. Declare the Wnd method
Protected Overrides Sub WndProc(ByRef m As Message)
If mdiClient IsNot Nothing Then
'Oculta as barras
ShowScrollBar(mdiClient.Handle, SB_BOTH, 0)
End If
MyBase.WndProc(m)
End Sub
3. Declare this field
Private mdiClient As MdiClient = Nothing
4. Put this in the initialization method of your initializer class
For Each c As Control In Me.Controls
'Procura os clientes MDI na sua janela
If TypeOf c Is MdiClient Then
mdiClient = CType(c, MdiClient)
End If
Next