请教关于循环的问题
想实现一个计算。在窗口中有radiobutton1和radiobutton2两个控件,点击radiobutton1进行x=a+b循环运算,点击radiobutton2循环计算结束。现在我写的程序是点击radiobutton1死循环,窗口处于无法响应状态。请帮忙解决下,这个程序应该如何写。谢谢
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace xunhuan
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
double x = 0;
double a = 2;
private void Form1_Load(object sender, EventArgs e)
{
do
{
label1.Text = x.ToString();
if (radioButton1.Checked == true)
{
x = x + a;
continue;
}
if (radioButton2.Checked == true)
{
break;
}
}
while (true);
}
}
}
这个是源代码