Duplicate declaration of member 'Location'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hamster
    New Member
    • Mar 2007
    • 12

    Duplicate declaration of member 'Location'

    Hi there

    Can anyone help.. Im getting this error : Duplicate declaration of member 'Location'
    and on my form all controls is on the left top corner.
    Is there anyway to fix this?
    When i run the program it looks ok, but once i make a change or try to then it stays that way.
    Im using VS2003 and C#.net

    thanks
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    1. In Microsoft Windows Explorer, locate the folder that contains the solution files (.suo).

    2. Delete the MySolution.suo file.
    The placeholder MySolution is the name of your solution.

    3. Reopen the solution in Visual Studio .NET 2002.

    This is a Temp fix and its a bug with VS2002 version. To fix this permanently, download latest service pack and install it (Servicepack1)

    Comment

    • hamster
      New Member
      • Mar 2007
      • 12

      #3
      Hi thanks for the assistance.

      I am using VS2003 though and i cant seem to find any of the (.suo) files
      Where can i find the Servicepack1?

      thanks a mil

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        I am unfamiliar with this problem but, I would recomend looking at your designer code (it's hidden in a REGION secion saying like "windows designer code" or something)
        And look for duplicate calls to .Location for an object?

        Comment

        • hamster
          New Member
          • Mar 2007
          • 12

          #5
          Hi thanks

          Here's my code you asked for.. I dont think there are any duplicates though.


          #region Windows Form Designer generated code
          /// <summary>
          /// Required method for Designer support - do not modify
          /// the contents of this method with the code editor.
          /// </summary>
          private void InitializeCompo nent()
          {
          System.Resource s.ResourceManag er resources = new System.Resource s.ResourceManag er(typeof(Print ));
          this.btnPrintPr eview = new System.Windows. Forms.Button();
          this.btnPageSet up = new System.Windows. Forms.Button();
          this.btnPrint = new System.Windows. Forms.Button();
          this.printDialo g1 = new System.Windows. Forms.PrintDial og();
          this.printDocum ent1 = new System.Drawing. Printing.PrintD ocument();
          this.printPrevi ewDialog1 = new System.Windows. Forms.PrintPrev iewDialog();
          this.pageSetupD ialog1 = new System.Windows. Forms.PageSetup Dialog();
          this.txtPrint = new RichTextBoxPrin tCtrl.RichTextB oxPrintCtrl();
          this.SuspendLay out();
          //
          // btnPrintPreview
          //
          this.btnPrintPr eview.Location = new System.Drawing. Point(608, 520);
          this.btnPrintPr eview.Name = "btnPrintPrevie w";
          this.btnPrintPr eview.Size = new System.Drawing. Size(88, 23);
          this.btnPrintPr eview.TabIndex = 1;
          this.btnPrintPr eview.Text = "Print Preview";
          //
          // btnPageSetup
          //
          this.btnPageSet up.Location = new System.Drawing. Point(504, 520);
          this.btnPageSet up.Name = "btnPageSet up";
          this.btnPageSet up.Size = new System.Drawing. Size(88, 23);
          this.btnPageSet up.TabIndex = 2;
          this.btnPageSet up.Text = "Page Setup";
          //
          // btnPrint
          //
          this.btnPrint.L ocation = new System.Drawing. Point(712, 520);
          this.btnPrint.N ame = "btnPrint";
          this.btnPrint.S ize = new System.Drawing. Size(88, 23);
          this.btnPrint.T abIndex = 3;
          this.btnPrint.T ext = "Print";
          this.btnPrint.C lick += new System.EventHan dler(this.btnPr int_Click);
          //
          // printDialog1
          //
          this.printDialo g1.Document = this.printDocum ent1;
          //
          // printPreviewDia log1
          //
          this.printPrevi ewDialog1.AutoS crollMargin = new System.Drawing. Size(0, 0);
          this.printPrevi ewDialog1.AutoS crollMinSize = new System.Drawing. Size(0, 0);
          this.printPrevi ewDialog1.Clien tSize = new System.Drawing. Size(400, 300);
          this.printPrevi ewDialog1.Docum ent = this.printDocum ent1;
          this.printPrevi ewDialog1.Enabl ed = true;
          this.printPrevi ewDialog1.Icon = ((System.Drawin g.Icon)(resourc es.GetObject("p rintPreviewDial og1.Icon")));
          this.printPrevi ewDialog1.Locat ion = new System.Drawing. Point(126, 23);
          this.printPrevi ewDialog1.Minim umSize = new System.Drawing. Size(375, 250);
          this.printPrevi ewDialog1.Name = "printPreviewDi alog1";
          this.printPrevi ewDialog1.Trans parencyKey = System.Drawing. Color.Empty;
          this.printPrevi ewDialog1.Visib le = false;
          //
          // pageSetupDialog 1
          //
          this.pageSetupD ialog1.Document = this.printDocum ent1;
          //
          // txtPrint
          //
          this.txtPrint.F ont = new System.Drawing. Font("Microsoft Sans Serif", 6F, System.Drawing. FontStyle.Regul ar, System.Drawing. GraphicsUnit.Po int, ((System.Byte)( 0)));
          this.txtPrint.L ocation = new System.Drawing. Point(24, 16);
          this.txtPrint.N ame = "txtPrint";
          this.txtPrint.S ize = new System.Drawing. Size(776, 488);
          this.txtPrint.T abIndex = 4;
          this.txtPrint.T ext = "";
          //
          // Print
          //
          this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
          this.ClientSize = new System.Drawing. Size(832, 566);
          this.Controls.A dd(this.txtPrin t);
          this.Controls.A dd(this.btnPrin t);
          this.Controls.A dd(this.btnPage Setup);
          this.Controls.A dd(this.btnPrin tPreview);
          this.Name = "Print";
          this.Text = "Print";
          this.Load += new System.EventHan dler(this.Print _Load);
          this.ResumeLayo ut(false);

          }
          #endregion

          Comment

          Working...