Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7410993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:19:05+00:00 2026-05-29T06:19:05+00:00

I fear that there is something obviously wrong with my code, but I have

  • 0

I fear that there is something obviously wrong with my code, but I have come across a situation where the Form.Load event is not firing when I create and show my form.

The form is not subclassed (as I’ve seen some problems with that in some searches), and I am not getting any errors thrown when I step through the code in the debugger.

I have a break point set on the IDE-created form load function (which does have the Handles MyBase.Load signature suffix) but the breakpoint is never reached and the form does display and work.

The form is passed three arguments in the constructor but the IntializeComponent() function is called before anything else is done.

Code:

Public Sub New(ByVal argA As Object, ByVal argB As Object, ByVal mode As FormMode)

    ' This call is required by the Windows Form Designer.
    InitializeComponent()

    ' Other code here,
    ' No errors generated
    '

End Sub

The form load function is as follows, (but this is never actually executed as the event is not fired).

Code:

Private Sub frmInstrumentEditor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If Not argA Is Nothing Then ' argA set in constructor
          ' Operations using argA
    End If
End Sub

I might add I am using some databinding with some controls and the argA object, but if this was producing an error I thought I would have seen this (I have CLR Execpetions settings set to Thown in the debugger > exceptions window)

Any ideas why this might be occurring?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:19:06+00:00Added an answer on May 29, 2026 at 6:19 am

    I just had a similar issue (it was in Shown event, not Load, but the root cause is the same). The reason was hidden deep in one of the ancestors – there was an unhandled NullReferenceException thrown and this exception was somehow “muted”.

    I found it after extensive debugging with F11.

    But… when writing this answer I found this post on SO

    Just add Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException) in your Main() method.

    If you’re using a 64-bit machine, it provides you with the solution (it worked in my case, too).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I come from a Java/Eclipse background and I fear that I am spoiled by
I fear that some of my code is causing memory leaks, and I'm not
I'm developing a project that works on remote server database tables. But there were
I fear that I miss a very basic point, but I'm stuck at the
I'm new to posting on these forums but have come here multiple times for
I am reviewing this technology but have a few design concerns that made me
I fear I may be trying to do something that certain security policies are
I think I have something like programmer's OCD. I like my code to be
I'm looking for a light-weight UI toolkit written in Javascript (something like Swing) but
I have developed a blog application of sorts that I am trying to allow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.