日期:2014-05-17 浏览次数:20941 次
//form1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication3
{
public partial class Form1 : Form
{
public int direction = -1;
bool started;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (!started)
{
started = true;
timer1.Start();
button1.Text = "停止";
}
else
{
started = false;
timer1.Stop();
button1.Text = "开始";