Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB2010 Hide startup form completely

Posted on 2010-11-19
6
Medium Priority
?
775 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 83

Assisted Solution

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

Accepted Solution

by:
andr_gin earned 1400 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

885 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