Correct me if I’m wrong, but to deactivate you can follow these attempts:
- Has some control within the shape that is extending the size of it, or is larger than the window itself.
- Change the property
AutoScroll
for False.
- Change the property
AutoScaleMode
for Dpi
.
- Move some controls to a visible location in the window.
Didn’t you? I found this model on this filing cabinet. Try the following:
1. State 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
Cypherpotato, your tip worked dear! _ But there’s a problem with the visualization... The scrollbars are flashing like a lag or something when mdichild goes through the corners... I think the solution would be to assign the Mdichilds window as None and thus prevent them from moving... Seems like the best option
– Wesley Silva
You can also create a Timer, with
interval
set to 1 millisecond, which when making the eventTimer1.Tick
can restore the location of a Mdichild to an objectSystem.Drawing.Point
(Local) fixed, then when the user tries to move it it will go back to the Timer location. Here’s the hint ;)– CypherPotato