We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

VB.NET (NetFramework 3.5) Can't hide startup form in VB.NET

GameOverlayUI
on
Medium Priority
549 Views
Last Modified: 2012-05-07
Hi, Im not able to hide vb.net startup form.

Tried :

me Me.Visible = False
me.hide

Public Class Form3
 
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim start_info As New ProcessStartInfo("upd.exe")
        Dim proc As New Process
        proc.StartInfo = start_info
        proc.Start()
        proc.WaitForExit()
        LoginForm1.Show()
        Me.Visible = False
    End Sub
End Class

Open in new window

Comment
Watch Question

Kevin CrossChief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011

Commented:
Did you try moving the Me.Hide() to the top of the sub, so like this:
Public Class Form3
 
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Hide()
        Dim start_info As New ProcessStartInfo("upd.exe")
        Dim proc As New Process
        proc.StartInfo = start_info
        proc.Start()
        proc.WaitForExit()
        LoginForm1.Show()
    End Sub
End Class

Open in new window

Jorge PaulinoIT Pro/Developer
CERTIFIED EXPERT
Top Expert 2008

Commented:
You can change the Opacity to 0 to hide the form.
Kevin CrossChief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011

Commented:
Otherwise, you can try changing your application to launch through Sub Main first instead of form, then from your Sub Main (Module) you load up the login form instead of starting with Form3.

Author

Commented:
opacity is not working either..
Jorge PaulinoIT Pro/Developer
CERTIFIED EXPERT
Top Expert 2008

Commented:
You want to run that code in the start up ? Can you describe more ?
Kevin CrossChief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011

Commented:
Did my suggestions not work either?

Author

Commented:
I put me.hide on top of the form and also opacity to 0, the form is not visible but still stay in taskbar menu

Author

Commented:
mwvisa1: can you type code how to do that.

Author

Commented:
btw, my application starts with loginform

Author

Commented:
i mean should start, but I use form3 to check update before login form is shown
IT Pro/Developer
CERTIFIED EXPERT
Top Expert 2008
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Kevin CrossChief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011

Commented:
JPaulino got it.  It is pretty much same idea.  The initial method I was talking about was creating a Module with Sub Main then in the same place (My Project) you can change the startup to be Sub Main instead of Form3, but this should work for you.

Author

Commented:
thanks.
Jorge PaulinoIT Pro/Developer
CERTIFIED EXPERT
Top Expert 2008

Commented:
That's right mwvisa1, the only problem creating a Sub Main in a module is that you have to disable the application framework, and all that option you have, to allow select the module.
But it works the same way.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.