Tchala B

Tchala B

  • NA
  • 52
  • 14.3k

WinForms designer error variable is undeclared or unassigned

May 20 2017 5:21 AM
My windows form application form form is giving an error when i change to design mode in visual studio 2015.
It says "The variable 'componentResourceManager' is either undeclared or was never assigned. "
Here is the line with the error
 
  1. this.pictureBox1.Image = (Image) componentResourceManager.GetObject("pictureBox1.Image");


  2. and here is how i initialized the resourcemanager

    1. private void InitializeComponent()  
    2.     {  
    3.       this.components = (IContainer) new Container();  
    4.       ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (frmMainMDI)); 
But when i run the application all the forms load well.What could be the problem?

Answers (1)