Skip to content

Issue displaying main form #458

Description

@itg-assistant

redcard asked 2016-12-02 13:38:26 UTC

Hello, I have spent over a day trying to resolve an intermittent issue.  I am unable to recreate this issue in a sample app, nor am I able to recreate it with any real consistency.  But I'm hoping you can make a suggestion to help me out, so here it goes...

LoginForm contains a user/password text box and a login button.   Upon successful login, LoginForm fires an event.  Here is the relevant code from Program.cs

static void Main()
{
LogonForm logonForm = new LogonForm();
logonForm.Authenticated += LogonForm_Authenticated;
logonForm.Show();
}

private static void LogonForm_Authenticated(object sender, EventArgs e)
{
MainForm mainForm = new MainForm();
mainForm.Show();
}

MainForm does a ton of crap on load.  It builds a main menu, checks security, runs multiple database queries.  Our current VWG app takes 5-ish seconds to load the form after login.

But roughly 75% of the time, MainForm displays as an empty form (in WiseJ).   The main menu is there and can be used to open screens.  But the "NewsPage" (our default page we display after login, contains a datagrid and html panel) is not shown.  About 20% of the time it is shown perfectly.  About 5% of the time I get 3-15 error message boxes saying "Component not found"  (I have no idea which component) and then an empty MainForm.

And, to add to this gripping mystery, if I add a breakpoint anywhere during the MainForm load logic, the NewsPage is displayed perfectly.

I've tried everything I can think of.  I cannot (so far) recreate the issue in a sample app.  I cannot get any of those three failures to happen with any consistency.  I've tried (just to name a few):

  • Displaying another page on login (besides NewsPage)
  • Adding timers to throw events to load the NewsPage 5 seconds after FormLoad is complete
  • Using ShowDialog() instead of Show()
  • Loading the NewsPage into MainForm after instantiation but before FormLoad
  • Adding LogonForm to a desktop control

And what feels like 100 things over the past day and a half.  If you have any other suggestions please let me know.
Thanks,
Andrew

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken or behaving unexpectedly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions