-
How to hide the form?
I want to Hide the form when the application start.
I write :
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Hide()
End Sub
But when the application start, I still see the form.
The form doesn't hide.......
How could I do?
Thanks.
-
I had the same problem before and I couldnt solve it. One easy way that you could get it to work is to set the opacity of the form to zero, it works perfect but it may not be the "correct" way to do this.
I also tried to load a form in a module and and make it invisible, I dont remember if that one worked or not, but you can try the opacity thingie
good luck
-
In the form's constructor, you could set the visible property to false.
Code:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
me.visible = false
End Sub
...
...
...
-
-
I have an idea, run your program from Sub Main rather than from a form! Then, you can show your form whenever you want.
Just go into project propreties, and set the startup object to Sub Main. Then, make a 'loader' class like the one listed.
Code:
Public Class Loader
Public Shared Sub Main()
'Do whatever you need to do in here
End Sub
End Module
Remember, if you want to keep your application running after Sub Main terminates, call System.Windows.Forms.Application.Run().
-
well I had a problemmo with doing that before. I cant really remember what it was. You think it's gunno work and then it doesnt, like the visible thingie that you had in your code. Anyways the easiest way is to set the opacity to zero :D:D:D
one question: if you run your app by application.run, can you access the form's properties and set the visible property to false?
-
Thanks everyone!
I think the opacity=0 is a good method.....
thanks everybody
especially Mr.MrPolite