none
no suitable method found to override

    Question

  • namespace AI
    {
        partial class Form1
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;

            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }

            #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 InitializeComponent()
            {
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
                this.SuspendLayout();
                // 
                // Form1
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
                this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                this.ClientSize = new System.Drawing.Size(1230, 596);
                this.Name = "Form1";
                this.Text = "Form1";
                this.Load += new System.EventHandler(this.Form1_Load);
                this.ResumeLayout(false);

            }

            #endregion
        }
    }
    Thursday, March 30, 2017 9:20 PM

All replies

  • Is Form1 derived from Form?
    Thursday, March 30, 2017 10:10 PM
  • Hi,

    is the rest of the Form1 also in that Namespace? Is at least one of the Form1 codefiles inheriting from System.Windows.Forms.Form? Maybe somewhere a typo? Case sensitive related error?

    ...

    Regards,

      Thorsten


    Thursday, March 30, 2017 10:10 PM
  • This is a designer generated file and lines up with what would be generated when you create a new winforms app. My gut instinct is that you went into your Form1.cs file and change the name of Form1 to something else and then attempted to compile. With the designer generated code it is split across multiple files so you have to rename the type in each place.

    To "properly" rename a type so that VS will fix everything up for you do one of the following:

    1) Right click the file in Solution Explorer and rename it there. Provided the filename matches the type name VS will prompt to rename the type as well as all references.

    2) Right click the type name in the file and select Rename (F2 I think). Then type in a new name. All references to it will be renamed. You'll still need to rename the file manually.

    Michael Taylor
    http://www.michaeltaylorp3.net

    Friday, March 31, 2017 3:25 PM
    Moderator