joker77 Posted April 4, 2007 Posted April 4, 2007 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. Quote What if the Hokey-Pokey IS what it's all about?
Administrators PlausiblyDamp Posted April 4, 2007 Administrators Posted April 4, 2007 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
joker77 Posted April 4, 2007 Author Posted April 4, 2007 You are indeed right PlausiblyDamp - thanks for your help! Quote What if the Hokey-Pokey IS what it's all about?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.