求大神啊!!!C#出现了targetInvocationException的问题
他说我出现了那个问题,发现错在那个输入赋值的地方,也就是timer控件里面的东西,怎么样才能解决?有些代码我删除了,因为太多放不下。
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
const double pi = 3.141592654;
double δ0, δ1, δ2, δ3;
double r0, r1, w, h, e0;
double[] sva = new double[3];
int i, angle;
int x1, y1;
//初始值
private void button2_Click(object sender, EventArgs e)
{
comboBox1.Text = "(1)偏置(或对心)尖顶推杆盘形凸轮";
comboBox2.Text = "(2)二次多项式";
comboBox3.Text = "(3)五次多项式";
textBox1.Text = "30";
textBox2.Text = "0";
textBox3.Text = "0.5";
textBox4.Text = "10";
textBox5.Text = "90";
textBox6.Text = "90";
textBox7.Text = "90";
textBox8.Text = "90";
textBox13.Text = "7";
}
//start
private void button3_Click(object sender, EventArgs e)
{
timer1.Interval = 500;
timer1.Enabled = true;
}
//pause
private void button4_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
}
//改用数据前请先清零
private void button5_Click(object sender, EventArgs e)
{
Graphics g1 = this.pictureBox1.Crea