public string VALUE_1()
{
string str = "";
int res1 = 1;
if (this.radx11IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx11Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
if (this.radx12IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx12Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
if (this.radx13IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx13Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
} if (this.radx14IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx14Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
if (this.radx15IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx15Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
return str; }
这段代码就是实现五组radio控件每组两个,一个代表1,一个代表0。现在有个问题及就是左边第一位不能为0,只有在第一位为1的时候才可以正常显示五位二进制数,当开头为0的时候就会不显示。只从显示第一个不为0的数显示
{
string str = "";
int res1 = 1;
if (this.radx11IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx11Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
if (this.radx12IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx12Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
if (this.radx13IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx13Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
} if (this.radx14IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx14Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
if (this.radx15IN.Checked == true)
{
res1 = 1;
str += res1.ToString();
}
if (this.radx15Out.Checked == true)
{
res1 = 0;
str += res1.ToString();
}
return str; }
这段代码就是实现五组radio控件每组两个,一个代表1,一个代表0。现在有个问题及就是左边第一位不能为0,只有在第一位为1的时候才可以正常显示五位二进制数,当开头为0的时候就会不显示。只从显示第一个不为0的数显示
{
//判断其他
}