Bring newest child form to top

smiles

Well-known member
Joined
May 21, 2008
Messages
47
Programming Experience
Beginner
I try codes and search around but still can't find it.
That when I click to add new child form, the newest child form always appear after the old one
VB.NET:
    Public leftX As Integer = 0
    Public topY As Integer = 0
    Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
        Dim newForm As New childForm
        newForm.TopLevel = False
        Me.Controls.Add(newForm)
        newForm.Left = leftX
        newForm.Top = topY
        newForm.Show()
        newForm.MdiParent = Me
        leftX = leftX + 25
        topY = topY + 25
    End Sub
Try activate, focus, bringtofront ... but still not work :mad:
Any idea for this, thanks ;)
 
Back
Top