//计手燃算水平纤薯神毁亏边长和高差
double a2 = String.IsNullOrEmpty(this.tb2.Text)?0:Convert.ToDouble(tb2.Text);
double a21 = String.IsNullOrEmpty(this.tb21.Text)?0:Convert.ToDouble(tb21.Text);
double a22 = String.IsNullOrEmpty(this.tb22.Text)?0:Convert.ToDouble(tb22.Text);
double a23 = String.IsNullOrEmpty(this.tb23.Text)?0:Convert.ToDouble(tb23.Text);
//判断度分秒的正负情况
if (a21 < 0)
{
a22 = a22 * (-1);
a23 = a23 * (-1);
}
else if (a22 < 0)
{
a23 = a23 * (-1);
}
double a211 = a2 * (Math.Cos((3.1415926 / 180) * (a21 + a22 / 60 + a23 / 3600)));
double a212 = a2 * (Math.Sin((3.1415926 / 180) * (a21 + a22 / 60 + a23 / 3600)));
tb211.Text = a211.ToString();
tb212.Text = a212.ToString();
设唯没液置指物初始值为零 textbox.defuse=0;
设施textbox的失去焦点事件 判断内容为空 就设置为0
textbox.lostfocus()
{if textbox.value="" then textbox.value=0;
}
我察闭用伪码写的 请自行修改
if(TextBox1.text=="")
{TextBox1.text="0";}
晕,很简单啊
textBox1.text=0;
就这样 ,ok
页面闷银罩加载
protected void Page_Load(object sender, EventArgs e)
{
textbox名.text="蚂闹搏昌0";
}