Solved

VB2010 Hide startup form completely

Posted on 2010-11-19
6
766 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

21 Experts available now in Live!

Get 1:1 Help Now