Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (textBox1.Text != "" && textBox2.Text != "")
- {
- BigInteger num1 = new BigInteger(textBox1.Text);
- BigInteger num2 = new BigInteger(textBox2.Text);
- BigInteger num3 = num1.add(num2);
- label2.Text = num3.ToString();
- textBox1.Text = "";
- textBox2.Text = "";
- }
- }
- private void KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!(char.IsDigit(e.KeyChar) || e.KeyChar == (char)Keys.Delete || e.KeyChar == (char)Keys.Back || e.KeyChar == '-' ||
- ((Control.ModifierKeys & Keys.Control) == Keys.Control)))
- {
- e.Handled = true;
- System.Media.SystemSounds.Beep.Play();
- }
- }
- private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e)
- {
- e.Handled = true;
- System.Media.SystemSounds.Beep.Play();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment