您的位置:首页 > 编程语言 > C#

C#界面设计之窗体绘制

2016-04-06 12:41 651 查看
先上运行结果啦!



解决方案管理图:



主要代码如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FormDraw
{
public partial class DrawForm : Form
{
public DrawForm()
{
InitializeComponent();
}
}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace FormDraw
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new DrawForm());
}
}
}


namespace FormDraw
{
partial class DrawForm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows 窗体设计器生成的代码

/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DrawForm));
this.mainMenuStrip = new System.Windows.Forms.MenuStrip();
this.SuspendLayout();
//
// mainMenuStrip
//
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
this.mainMenuStrip.Name = "mainMenuStrip";
this.mainMenuStrip.Size = new System.Drawing.Size(785, 24);
this.mainMenuStrip.TabIndex = 0;
this.mainMenuStrip.Text = "menuStrip1";
//
// DrawForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(785, 467);
this.Controls.Add(this.mainMenuStrip);
this.Cursor = System.Windows.Forms.Cursors.Cross;
this.MainMenuStrip = this.mainMenuStrip;
this.Name = "DrawForm";
this.Text = "窗体绘制";
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.MenuStrip mainMenuStrip;
}
}


不积跬步,无以至千里,加油!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息