sorry, that's in win form!
解决方案 »
- SQL高手进来,跪求一条SQL语句
- 高分求一套asp.net2.0开发的网上购物系统(电子商务系统)
- 最近上一个项目,对效率要求比较高,字符匹配是正则表达式快还是IndexOf快呢?
- 如何在winform中将datagrid中的数据导出到excel中!
- 数据库操作没结果返回啊!迷糊
- 基础数组问题
- Sql Server2000 数据库
- C#开发的看门狗源码
- 在wpf中使用Image控件绑定数据库中为image类型的数据
- C#下如何实现windows录音,可设置采样率、声道等参数,.net下其它语言也行,最好有源码,急用
- 把DataSet中修改後的數據提交到數據庫,在線等
- 关于模式对话框使用的一些问题
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;namespace WinApp
{
/// <summary>
/// Summary description for frmTest.
/// </summary>
public class frmTest : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
public System.Windows.Forms.PictureBox pictureBox1;
private System.ComponentModel.Container components = null; public frmTest()
{
InitializeComponent();
} protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} [STAThread]
public static void Main()
{ Application.Run(new frmTest()); } #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.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmTest));
this.button1 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(32, 224);
this.button1.Name = "button1";
this.button1.TabIndex = 2;
this.button1.Text = "LoopStop";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(32, 24);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(312, 136);
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// frmTest
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(512, 485);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.pictureBox1,
this.button1});
this.Name = "frmTest";
this.Text = "frmTest";
this.Load += new System.EventHandler(this.frmTest_Load);
this.ResumeLayout(false); }
#endregion private void button1_Click(object sender, System.EventArgs e)
{
//模拟后台程序
double l;
for(int i=1;i<5;i++)
{
for(int j=1;j<30000;j++)
for(int k=1;k<1000;k++)
l=(j+k)/(2*j+2*k);
}
} }
}
private void button1_Click(object sender, System.EventArgs e)
{
ThreadStart ts=new ThreadStart(calculate);
Thread newThread=new Thread(ts);
ts.IsBackground=true;
newThread.Start();
}
private void calculate()
{
double l;
for(int i=1;i<5;i++)
{
for(int j=1;j<30000;j++)
for(int k=1;k<1000;k++)
l=(j+k)/(2*j+2*k);
}
}