How do I hide a form?  
Author Message
Martin Hooper





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

I am looking to create a simple program that pops up a balloon on startup.

What I want to do is hide the form1 that is created. How do I do it

I can use the notifyicon for displaying the balloon no problem.




Visual Studio Express Editions44  
 
 
tattoo





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

Hello Martin,

I haven't tried this myself but maybe Me.Hide()

hope it works

tattoo


 
 
Shady9399





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

Try this

Private Sub Form1_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged

Me.Hide()

End Sub

or

Private Sub Form1_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged

Me.Visible = false

End Sub



 
 
SJWhiteley





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

You may have to take a few extra steps, since just 'hiding' the form may cause it to flicker: Set the opacity to zero, so it's completely transparent (and perhaps set showintaskbar false).

 
 
Martin Hooper





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

Try this

Private Sub Form1_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged

Me.Hide()

End Sub

or

Private Sub Form1_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged

Me.Visible = false

End Sub



Already tried Me.Hide and just tried me.visible and that doesn't work either...



 
 
ReneeC





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

How does it, "not work"



 
 
Martin Hooper





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

The form is still open on the desktop. It needs to be hidden from view. Not too bothered about it being in the taskbar though.



 
 
SJWhiteley





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

Did you try setting the opacity



 
 
DMan1





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

The form is still open on the desktop. It needs to be hidden from view. Not too bothered about it being in the taskbar though.

Me.WindowState = FormWindowState.Minimized



 
 
Martin Hooper





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

Ahh That would work... Although I used sendkeys to minimize it. ;)




 
 
Chris Dunaway





PostPosted: Visual Basic Express Edition, How do I hide a form? Top

If you do not want the form to be visible, then don't show it!! That is the easiest way to accomplish what you want.

You can instantiate the form if you need to without showing it.

Chris