Guidance Required: Select a Form upon Application Start

  • Thread starter Thread starter XRTEKK
  • Start date Start date
X

XRTEKK

Guest
Greetings;

I'm facing a Construction problem, and need some guidance to help me understand why I'm facing issues and how to do things properly (find the best practice or a better practice for this matter).

I need to Load a specific Form at Application Startup depending on a Certain Condition.
In my current scenario: A specific Form should open depending if an Account Exists in Database or not.

Let's say:

if (Database_HasValidAccounts()) { /* Open Login Form from Warpped Class */ }
else { /* Open Account Manager or registration Form from Wrapped Class */ }

The "Wrapped Class" mentioned above: represents a class to Manage all the Forms in my Project and Contains all the Customization Properties using static fields.

At the moment I'm attempting to do this in Program.cs Class.
This seems to be the logical starting place to perform the check and form selection before showing anything; yet I feel that I am wrong.
The application runs the Forms required; however after Logging in; the Main Form is Shown (without any controls - even though it should contain them); and after a few seconds the Application Closes without any Exception being thrown.
I'm guessing this is a construction problem by using the Program.cs class.

Can someone point me in the right direction?

Thanks in advance.

Continue reading...
 
Back
Top