Sashika_1 0 Newbie Poster

I find something related to this topic and found. But I can't satisfie with this. The code is below.

Imports System.Runtime.InteropServices

Public Class Form1
    Private Const SB_BOTH As Integer = 3
    Private Const WM_NCCALCSIZE As Integer = &H83

    <DllImport("user32.dll")> _
    Private Shared Function ShowScrollBar(ByVal hWnd As IntPtr, ByVal wBar As Integer, ByVal bShow As Integer) As Integer
    End Function

    Protected Overrides Sub WndProc(ByRef m As Message)

        If mdiClient IsNot Nothing Then

            'Hide the ScrollBars

            ShowScrollBar(mdiClient.Handle, SB_BOTH, 0)
        End If

        MyBase.WndProc(m)

    End Sub

    Private mdiClient As MdiClient = Nothing

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load

        For Each c As Control In Me.Controls
            'Find the MdiClient in the MdiWindow

            If TypeOf c Is MdiClient Then

                mdiClient = TryCast(c, MdiClient)

            End If
        Next
        'Dim F2 As New Form2
        'F2.MdiParent = Me
        'F2.Show()

        'Dim F3 As New Form3
        'F3.MdiParent = Me
        'F3.Show()

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim F2 As New Form2
        F2.MdiParent = Me
        F2.Show()
    End Sub
End Class

But whenever I move child form inside the mdi form. The scroll bars shows and go like ghosts. I want to know is there way to stop this ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.