Solved

VB2010 Hide startup form completely

Posted on 2010-11-19
6
764 Views
Last Modified: 2012-05-10
Hey there,

I am needing to hide my startup form completely.
The startup form is a registration form, which checks to see whether the program is registered in the load event using a boolean function. If the function returns true, it moves onto the splash form, if it returns false, it stays on the registration form.

The registration works correctly, sees the program is registered and shows the splash form, but also displays the registration form.

How do I go about unloading/ hiding the registration form if true is returned?

Thanks!
Jessee
0
Comment
Question by:Letsgetcoding
6 Comments
 
LVL 10

Expert Comment

by:ALaRiva
ID: 34175057
Are you using a Sub Main to launch the application, or do you have the Registration Form as the Startup Object?

A little more info on how you are doing things will help us offer a solution.

- Anthony
0
 
LVL 10

Expert Comment

by:Mathiyazhagan
ID: 34175373
it is something like,
If the Registration validation function returns true,you are creating splash object . hook Load event splash object in register form itself which hides the register form after loading splash screen.

--- code in register form
    if(ValidateProduct())
    {
           frmSplash objSplash = new frmSplash ();
           objSplash .Load += new EventHandler(obj_Load);
           objSplash.Show();

    }
    void obj_Load(object sender, EventArgs e)
    {
            this.Hide(); // hides register form when splash from loaded
    }

Note : if you close register form in above code, it will close the application as it is start up object. find discussion on the same here at :EE Link


hope this helps.
0
 

Author Comment

by:Letsgetcoding
ID: 34178158
ALaRiva,

The registration form is the startup object.

Thanks,
Jessee
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 150 total points
ID: 34179721
Use the Me.Dispose after Splash.Show statement.
0
 
LVL 5

Accepted Solution

by:
andr_gin earned 350 total points
ID: 34180293
The sequence is like this:

1.) The constructor of the Form is called
2.) The event Form_Load is called
3.) The Form gets visible (Form.Visible changes to True)
4.) The event Form_Shown is called

If set Form.Visible=False in the Form_Shown event the user will not see the Form.

You can do it like this:
Form_Load:
this._ApplicationRegistered = GetApplicationRegistered();

Form_Shown:
If(this._ApplicationRegistered)
     this._Visible=False;


You can also call this.Close in the Form_Load event and show the next Form afterwards.
In this case you have to set your application settings to "stop application when last form closes" instead of "stop application when startup form closes"
 

0
 

Author Closing Comment

by:Letsgetcoding
ID: 34197935
Changed application settings to "Stop application when last form closes" then used "Splash.Show" and "Me.Dispose"

Thanks guys :)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now