| |
|
| |
How to Avoid Common Designer ProblemsCommon problems that cause the Visual Studio forms designer to go kerflooey. See also Debugging Designer Problems and Loader Exceptions. Abstract Methods In Base ClassesAbstract methods in a base form/control class will cause the designer to crap out. This has to do with the fact that the designer tries to create the parent in addition to creating the child.
// Kills the designer.
public class BaseControl : UserControl
{
protected abstract void HandleLanguageChanged();
}
// Try this instead.
public class BaseControl : UserControl
{
protected virtual void HandleLanguageChanged()
{
throw new NotImplementedException(this.ToString() + " missing handle language method.");
}
}
Parameters In Base Class CTORsAgain this has to do with the designer trying to construct the base class object.
// Kills the designer.
public class BaseForm : Form
{
Remote m_remote;
public BaseForm(Remote remoteDisplay)
{
}
}
Other Classes In The Form Class FileThe form class has to be the first class in the form class file.
// Kills the designer
public class TriangleButtonColors
{
}
public class TriangleButton
{
}
// Try this instead
// (Or put them in separate files, which is generally better practice anyway.)
public class TriangleButton
{
}
public class TriangleButtonColors
{
}
| |
|
All content copyright 1996-2008 by Linda Naughton O'Meara unless otherwise noted.
Shadowrun is a copyright and trademark of WizKids, LLC.
Earthdawn is a copyright and trademark of FASA Corporation.
Crimson Skies is a copyright and trademark of Microsoft Corporation.
Babylon 5 is a copyright and trademark of Time Warner Entertainment.
Battlestar Galactica is a copyright of Sci Fi / Universal.
Any use of characters, names, places, etc. from these systems is done with the greatest respect for their creators, and is not intended as a challenge to any copyrights or trademarks.
| |