none
Problem Adding User Controls in VS 2010 RRS feed

  • Question

  • i'm adding some user controls to my form but when i debug my project VS 2010 send me this error

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

    what does that mean??(and its actually declared in the designer code)

    Saturday, May 12, 2012 11:39 PM

Answers

All replies

  • Simple.  Make change like this

    from : int a;

    to : int a = 0;


    jdweng

    Sunday, May 13, 2012 3:23 AM
  • Hi, 

    Reason for this , You have defined a variable but never was declared or assigned (here)

    This could be because of designer.cs issues, this can be solved close VS and open and rebuild. If not please provide the lines of code.


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

    Sunday, May 13, 2012 4:22 AM
  • Hi fabrivera,

    This is the issue with designer.cs. Probably you have declared a control, but forgt to initialize it,

    For exmple: you might have declared a label but forgot to do new for that as

    myLabel=new Label();

    Please check your code once. Sometimes, these things occur, on corruption of designer.


    Regards, http://shwetamannjain.blogspot.com

    Sunday, May 13, 2012 5:31 AM