Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi there,

 

I have a Form, upon which I have a UserControl. The OnLoad event of the UserControl contains some code to load in values from an XML file.

 

In the IDE, when I open the Form, an error is thrown because when it's pulling in the UserControl the .Load is looking at a null value (in runtime it's fine because this value is set).

 

Is there anyway to get around this? It's not causing a problem, just an annoying error message comes up whenever I load the project into the IDE, or open the Form.

What if the Hokey-Pokey IS what it's all about?
  • Administrators
Posted
Not got VS handly at the moment so I could be wrong, but I seem to remember that anything inheriting from System.ComponentModel.Component (which should include controls) will have a DesignMode property - just check the value of that before trying to load the XML file.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...