我有一个与标题错误有关的问题.我正在使用c#和Visual Studio 2010.
我有一个声明为"公共类FormularioGeneral:Form"的表单,它是我的应用程序中其余表单的基础.当我尝试访问Designer视图时,我会多次出现此错误,如图所示:
所有错误都引用InitializeComponent方法中的行,其中值被赋予像这样的属性:
[...]
this.PanelMargenIzquierdoCapaBase.BackColor = m_ColorCapaBase;
[...]
Run Code Online (Sandbox Code Playgroud)
但是所有变量都在与只读属性相同的类中声明,并且所有变量都在构造函数中调用的方法内分配.
财产声明:
protected Color m_VariableName;
public Color VariableName
{
get { return m_VariableName; }
set { }
}
Run Code Online (Sandbox Code Playgroud)
构造函数代码:
public FormularioGeneral()
{
ConfigurarUI();
AccionesConstructor();
InitializeComponent();
PostInicializacionComponentes();
EstablecerIcono();
InicializarLocalizacionFormulario();
}
Run Code Online (Sandbox Code Playgroud)
ConfigurarUI方法:
public virtual void ConfigurarUI()
{
[...]
m_AltoBordeSuperiorCapaBase = 30;
m_AltoBordeInferiorCapaBase = 7;
m_AnchoBordesLateralesCapaBase = 7;
m_ColorCapaBase = Color.FromArgb(50, 100, 150);
m_ColorTextoCapaBase = Color.White;
m_ColorTextoBotonAplicacion = Color.Black;
m_FuenteTextoIzquierdoCapaBase = new System.Drawing.Font("Verdana", 11.0F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
m_FuenteTextoCentroCapaBase = new System.Drawing.Font("Verdana", 14.0F, System.Drawing.FontStyle.Bold, …Run Code Online (Sandbox Code Playgroud)