⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 提供了大量初学CSharp的示例
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication4
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private Steema.TeeChart.TChart tChart1;
		private System.Windows.Forms.Button button1;
		private Steema.TeeChart.Styles.Pie pie1;
		private Steema.TeeChart.ButtonPen buttonPen1;
		private Steema.TeeChart.Editor editor1;
		private Steema.TeeChart.ChartListBox chartListBox1;
		private Steema.TeeChart.Commander commander1;
		private System.ComponentModel.IContainer components;

		public Form1()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.tChart1 = new Steema.TeeChart.TChart();
			this.button1 = new System.Windows.Forms.Button();
			this.pie1 = new Steema.TeeChart.Styles.Pie();
			this.buttonPen1 = new Steema.TeeChart.ButtonPen();
			this.editor1 = new Steema.TeeChart.Editor(this.components);
			this.chartListBox1 = new Steema.TeeChart.ChartListBox(this.components);
			this.commander1 = new Steema.TeeChart.Commander();
			this.SuspendLayout();
			// 
			// tChart1
			// 
			// 
			// tChart1.Aspect
			// 
			this.tChart1.Aspect.Elevation = 315;
			this.tChart1.Aspect.Orthogonal = false;
			this.tChart1.Aspect.Perspective = 0;
			this.tChart1.Aspect.Rotation = 360;
			this.tChart1.Aspect.View3D = false;
			this.tChart1.Cursor = System.Windows.Forms.Cursors.Default;
			// 
			// tChart1.Header
			// 
			this.tChart1.Header.Lines = new string[] {
														 "TeeChart"};
			this.tChart1.Location = new System.Drawing.Point(120, 64);
			this.tChart1.Name = "tChart1";
			this.tChart1.Series.Add(this.pie1);
			this.tChart1.TabIndex = 0;
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(592, 104);
			this.button1.Name = "button1";
			this.button1.TabIndex = 1;
			this.button1.Text = "button1";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// pie1
			// 
			// 
			// pie1.Brush
			// 
			this.pie1.Brush.Color = System.Drawing.Color.Red;
			// 
			// pie1.Marks
			// 
			this.pie1.Marks.Visible = true;
			// 
			// pie1.Shadow
			// 
			this.pie1.Shadow.Height = 20;
			this.pie1.Shadow.Width = 20;
			this.pie1.Title = "pie1";
			// 
			// buttonPen1
			// 
			this.buttonPen1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.buttonPen1.Location = new System.Drawing.Point(632, 264);
			this.buttonPen1.Name = "buttonPen1";
			this.buttonPen1.TabIndex = 2;
			this.buttonPen1.Text = "buttonPen1";
			this.buttonPen1.Click += new System.EventHandler(this.buttonPen1_Click);
			// 
			// editor1
			// 
			this.editor1.Chart = this.tChart1;
			// 
			// chartListBox1
			// 
			this.chartListBox1.Location = new System.Drawing.Point(504, 320);
			this.chartListBox1.Name = "chartListBox1";
			this.chartListBox1.Size = new System.Drawing.Size(136, 76);
			this.chartListBox1.TabIndex = 3;
			// 
			// commander1
			// 
			this.commander1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
			this.commander1.DropDownArrows = true;
			this.commander1.Name = "commander1";
			this.commander1.ShowToolTips = true;
			this.commander1.Size = new System.Drawing.Size(728, 34);
			this.commander1.TabIndex = 4;
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(728, 429);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.commander1,
																		  this.chartListBox1,
																		  this.buttonPen1,
																		  this.button1,
																		  this.tChart1});
			this.Name = "Form1";
			this.Text = "Form1";
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			pie1.Add(10, "Dev");
			pie1.Add(20.0, "Dev2");
			pie1.Add(15.0, "Dev3");
			//this.tChart1.
		}

		private void buttonPen1_Click(object sender, System.EventArgs e)
		{
		
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -