0

Good day!

There are 2 forms. When you click on the button of the first form, form2 appears at the second border

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

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim frm1Width As Integer = Width
        Dim frm1Top As Integer = Top
        Dim frm1Left As Integer = Left
        Dim delta As Integer = 485


        Form2.Show()
        Form2.Top = frm1Top
        Form2.Left = frm1Left - frm1Width + delta

    End Sub

In form2 there is a ban on moving beyond the heading

 Protected Overrides Sub WndProc(ByRef message As Message)
        Const WM_SYSCOMMAND As Integer = &H112
        Const SC_MOVE As Integer = &HF010

        Select Case message.Msg
            Case WM_SYSCOMMAND
                Dim command As Integer = message.WParam.ToInt32() And &HFFF0
                If command = SC_MOVE Then
                    Return
                End If
        End Select

        MyBase.WndProc(message)
    End Sub

Tell me how to make it so that it would be possible to move both forms beyond the header of form 1?

Lider13
  • 47
  • 7
  • In case you mean [Move Form1 when I move Form2](https://stackoverflow.com/questions/14796367/move-form1-when-i-move-form2-in-c-sharp). You can convert it to vb.net online. – dr.null Jul 11 '22 at 14:14
  • It's not quite clear what your requirement is. I *guess* you need to use a single form, hide the first content page, and show the seconds content page. All in the same form; and the content could be in some UserControls or [wizard-like pages](https://stackoverflow.com/a/40633229/3110834). – Reza Aghaei Jul 11 '22 at 17:15

0 Answers0