The variable 'variable_name' is either undeclared or was never assigned

前端 未结 16 960
甜味超标
甜味超标 2020-12-15 03:14

I have a question related to the error on the title. Im working with c# and Visual Studio 2010.

I have a form declared as \"public class FormularioGeneral : Form\",

16条回答
  •  天命终不由人
    2020-12-15 03:46

    I had this issue when my user control had some code in the constructor which was related to runtime resource. I added null check and it fixed.

            InitializeComponent();
            if (MyConfig!= null)
            {
                this.label2.Text = MyConfig.text1;
                this.label3.Text = MyConfig.text2;
                this.label1.Text = MyConfig.text3;
            }
    

提交回复
热议问题