Moving a form to the back.

  • Thread starter Thread starter HardySpicer
  • Start date Start date
H

HardySpicer

I know how to get a form always on top

Set the Form's TopMost Property to True

when I do this it immediately has the desired effect and moves to the
front.

When I make this false however although it cancels the effect the form
does not move to the back. Is there anotehr command for moving to the
back?


Thanks
 
HardySpicer was thinking very hard :
I know how to get a form always on top

Set the Form's TopMost Property to True

when I do this it immediately has the desired effect and moves to the
front.

When I make this false however although it cancels the effect the form
does not move to the back. Is there anotehr command for moving to the
back?


Thanks

Public Class Form1
Private frm As Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If frm Is Nothing Then
frm = New Form2
frm.Show()

End If

frm.TopMost = True
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
frm.TopMost = False
frm.SendToBack()
End Sub
End Class
 
HardySpicer was thinking very hard :






Public Class Form1
    Private frm As Form2
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
        If frm Is Nothing Then
            frm = New Form2
            frm.Show()

        End If

        frm.TopMost = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
        frm.TopMost = False
        frm.SendToBack()
    End Sub
End Class

Thanks Tom
 
Back
Top