Moving a form to the back.

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
 
T

Tom Shelton

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
 
H

HardySpicer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top