Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB2010 Hide startup form completely

Posted on 2010-11-19
6
Medium Priority
?
774 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
Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

661 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