Solved

VB2010 Hide startup form completely

Posted on 2010-11-19
6
770 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

624 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