-1

描画アプリケーションの作成にVisualStudio2010を使用していますが、問題は、プログラムをコンパイルしようとすると表示されることです。

1)タイプ名'DrawingBoard'がタイプ'DrawingBoard.DrawingBoard'の行33に存在しません

2)タイプ名「Toolbox」がタイプ「DrawingBoard.DrawingBoard」の34行目に存在しません

3)非静的フィールド、メソッド、またはプロパティ'DrawingBoard.DrawingBoard.EditOption.get'行74には、オブジェクト参照が必要です。

このプログラムのコードは以下のとおりです。文章題のエラーを指摘しました。助けていただければ幸いです。

using System.Drawing;

namespace DrawingBoard
{
    partial class WinForm
    {
        /// <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()
        {
            this.splitContainerMain = new System.Windows.Forms.SplitContainer();
            this.drawingBoard = new DrawingBoard.DrawingBoard();//problem
            this.toolBox = new DrawingBoard.Toolbox.ToolBox();//problem
            this.splitContainerMain.Panel1.SuspendLayout();
            this.splitContainerMain.Panel2.SuspendLayout();
            this.splitContainerMain.SuspendLayout();
            this.SuspendLayout();
            // 
            // splitContainerMain
            // 
            this.splitContainerMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainerMain.Location = new System.Drawing.Point(0, 0);
            this.splitContainerMain.Margin = new System.Windows.Forms.Padding(2);
            this.splitContainerMain.Name = "splitContainerMain";
            // 
            // splitContainerMain.Panel1
            // 
            this.splitContainerMain.Panel1.Controls.Add(this.drawingBoard);
            // 
            // splitContainerMain.Panel2
            // 
            this.splitContainerMain.Panel2.Controls.Add(this.toolBox);
            this.splitContainerMain.Size = new System.Drawing.Size(853, 553);
            this.splitContainerMain.SplitterDistance = 532;
            this.splitContainerMain.SplitterWidth = 3;
            this.splitContainerMain.TabIndex = 37;
            // 
            // drawingBoard
            // 
            this.drawingBoard.AllowDrop = true;
            this.drawingBoard.AutoScroll = true;
            this.drawingBoard.BackColor = System.Drawing.Color.White;
            this.drawingBoard.BackgroundImageAlpha = ((byte)(255));
            this.drawingBoard.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.drawingBoard.BackgroundImageX = 0;
            this.drawingBoard.BackgroundImageY = 0;
            this.drawingBoard.BoundedCanvasHeight = 1140;
            this.drawingBoard.BoundedCanvasWidth = 810;
            this.drawingBoard.CanvasOriginX = 0;
            this.drawingBoard.CanvasOriginY = 0;
            this.drawingBoard.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.Default;
            this.drawingBoard.Dock = System.Windows.Forms.DockStyle.Fill;
            this.drawingBoard.EditOption = DrawingBoard.EditOption.Select; //problem
            this.drawingBoard.GridColor = System.Drawing.Color.Gainsboro;
            this.drawingBoard.GridSize = 0;
            this.drawingBoard.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default;
            this.drawingBoard.IsBoundedCanvas = true;
            this.drawingBoard.Location = new System.Drawing.Point(0, 0);
            this.drawingBoard.Name = "drawingBoard";
            this.drawingBoard.PaperOutsideColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(255)))));
            this.drawingBoard.ShowPaperOutside = true;
            this.drawingBoard.Size = new System.Drawing.Size(532, 553);
            this.drawingBoard.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            this.drawingBoard.StickyEditOption = true;
            this.drawingBoard.TabIndex = 3;
            this.drawingBoard.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
            this.drawingBoard.Zoom = 1F;
            // 
            // toolBox
            // 
            this.toolBox.AutoSize = true;
            this.toolBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.toolBox.Drawingboard = null;
            this.toolBox.Location = new System.Drawing.Point(0, 0);
            this.toolBox.Margin = new System.Windows.Forms.Padding(4);
            this.toolBox.Name = "toolBox";
            this.toolBox.Size = new System.Drawing.Size(318, 553);
            this.toolBox.TabIndex = 1;
            // 
            // WinForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            this.ClientSize = new System.Drawing.Size(853, 553);
            this.Controls.Add(this.splitContainerMain);
            this.Name = "WinForm";
            this.Text = "DrawingBoard";
            this.splitContainerMain.Panel1.ResumeLayout(false);
            this.splitContainerMain.Panel2.ResumeLayout(false);
            this.splitContainerMain.Panel2.PerformLayout();
            this.splitContainerMain.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.SplitContainer splitContainerMain;
        private DrawingBoard drawingBoard;
        private global::DrawingBoard.Toolbox.ToolBox toolBox;

    }
}
4

1 に答える 1

0

名前空間に問題があるようDrawingBoard.DrawingBoardで、おそらく混乱を招くようです。名前空間の名前を変更して、重複する名前を省略してください。などのフォーマットを使用しますSolution.Project.Module。あなたの場合、それは可能性がありますMySolution.DrawingBoard

于 2012-06-12T14:52:42.717 に答える