level 1
先把文本框原来的值取出来 加上新按钮的值 再赋值给文本框
2019年02月25日 07点02分
2
谢谢大神的思路,以做好,现在想把这个二进制转成十六进制,求代码
2019年02月25日 13点02分
level 9
textBox1.Text += button.Text;
2019年02月25日 08点02分
3
level 5
谢谢吧友们,已做好,现在想把这个二进制转成16进制,求代码,我发上代码,请指教
2019年02月25日 13点02分
7
level 5
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 电平计算器
{
public partial class Form1 : Form
{
string a, b, c, d, a1, b1, c1, d1;
public Form1()
{
InitializeComponent();
}
private void button9_Click(object sender, EventArgs e)
{
a = "1"; b = "1"; c = "1"; d = "1"; a1 = "1"; b1 = "1"; c1 = "1"; d1 = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
private void button10_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "1")
{
button1.Text = "0";
a = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button1.Text = "1";
a = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void button2_Click_1(object sender, EventArgs e)
{
if (button2.Text == "1")
{
button2.Text = "0";
b = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button2.Text = "1";
b = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void button3_Click_1(object sender, EventArgs e)
{
if (button3.Text == "1")
{
button3.Text = "0";
c = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button3.Text = "1";
c = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void button4_Click_1(object sender, EventArgs e)
{
if (button4.Text == "1")
{
button4.Text = "0";
d = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button4.Text = "1";
d = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void button5_Click_1(object sender, EventArgs e)
{
if (button5.Text == "1")
{
button5.Text = "0";
a1 = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button5.Text = "1";
a1 = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void button6_Click_1(object sender, EventArgs e)
{
if (button6.Text == "1")
{
button6.Text = "0";
b1 = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button6.Text = "1";
b1 = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void button7_Click_1(object sender, EventArgs e)
{
if (button7.Text == "1")
{
button7.Text = "0";
c1 = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button7.Text = "1";
c1 = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void button8_Click_1(object sender, EventArgs e)
{
if (button8.Text == "1")
{
button8.Text = "0";
d1 = "1";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
else
{
button8.Text = "1";
d1 = "0";
textBox1.Text = a + b + c + d + a1 + b1 + c1 + d1;
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
2019年02月25日 13点02分
8