在文章(一)的基础上绘制直方图:
此时先在原有项目中添加一个新的窗体,并添加相应的控件,其在histForm.Designer.cs中的代码如下:
//
// close
//
this.close.Location = new System.Drawing.Point(262, 275);
this.close.Name = "close";
this.close.Size = new System.Drawing.Size(75, 23);
this.close.TabIndex = 0;
this.close.Text = "关 闭";
this.close.UseVisualStyleBackColor = true;
this.close.Click += new System.EventHandler(this.close_Click);
//
// histForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(339, 302);
this.ControlBox = false;
this.Controls.Add(this.close);
this.Name = "histForm";
this.Text = "直方图";
this.Load += new System.EventHandler(this.histForm_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.histForm_Paint);
this.ResumeLayout(false);
在Form1窗体上添加按钮控件,用于打开histForm窗体,其属性在Form1.Designer.cs中代码如下所示:
//
// histogram
//