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 520217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:07:19+00:00 2026-05-13T08:07:19+00:00

have a really annoying time developing some code for a set of UserControls that

  • 0

have a really annoying time developing some code for a set of UserControls that utilize fairly rudimentary inheritance. Basically, they are three different Detail Views which all inherit from a single Base Class which in turn Implements a Single Interface.

Interface IBaseDetailView

Class BaseDetailView : Implements IBaseDetailView

Class DetailView1 : Inherits BaseDetailView
Class DetailView2 : Inherits BaseDetailView
Class DetailView3 : Inherits BaseDetailView

Then I have a Composite UserControl That adds the individual DetailViews 1-3 on a tab on the TabControl.

Pretty Simple stuff. Everything compiles fine, All the UserControls are available in the toolbox and can be dragged and dropped onto any form. But there is one problem…

They initially display and what not, but after compiling the form errors out with the infamous “Instance of object not set to reference” error.

Now, for a bit more info… If I comment out the Form_Load events in each of the DetailView concrete/derived classes this error goes away and the form can be viewed in design mode. The Form_Load events have ado.net calls to a sql server which seem to trigger the errors.

With the Form_Load events in tact I don’t receive any errors upon compilation and I can run the applications without a problem while in debug or release mode. I just can’t view any forms with the UserControls in DesignMode.

I have added the If Me.DesignMode Then Return to the Form_Load events but it didn’t work. I think VS2008 is actually trying to run the code in the UserControls… I googled this but I have not found a solution. Any help is MUCH appreciated!

  • 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-13T08:07:20+00:00Added an answer on May 13, 2026 at 8:07 am

    Put a null check in around properties/fields in the Form_Load method. We had similar issues as the designer seems to use FormLoad at design time, not what you would expect.

    There is also a DesignMode property that you could use.

    I hope this helps.

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

Sidebar

Related Questions

This is a really odd one that has been annoying me for some time,
Hey I have a really annoying IE7 bug that I am trying to work
I have a really annoying problem that I tried to solve for a few
I am stuck with something quite simple but really annoying: I have an xml
This is really annoying me as I have done it before, about a year
The stop executable dialog that comes up every time I have an app already
So I have hosting that refuses to update to PHP 5.3 (which is annoying
I have this situation that is really irritating me now. At random times with
as we all experienced one time or more, it sometimes is really annoying to
I have two very annoying issues with Maven-Eclipse integration, from time to time it

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.