Programming, Music, Games. Creation.

[C#] Binary Swift v2

Download url on the bottom

This is kinda my 1st C# program xD

Simply input any integer into one of the boxes, the value for others will chage too :D

Code for ‘Form 1.cs’

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 WindowsFormsApplication1
{

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            int number = int.Parse(textBox1.Text);
            textBox2.Text = Convert.ToString(number, 16);
            textBox3.Text = Convert.ToString(number, 8);
            textBox4.Text = Convert.ToString(number, 2);
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            int F8T10 = Convert.ToInt32((textBox3.Text), 8);
            textBox1.Text = Convert.ToString(F8T10);
            textBox4.Text = Convert.ToString(F8T10, 2);
            textBox2.Text = Convert.ToString(F8T10, 16);
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            int F16T10 = Convert.ToInt32((textBox2.Text), 16);
            textBox1.Text = Convert.ToString(F16T10);
            textBox3.Text = Convert.ToString(F16T10, 8);
            textBox4.Text = Convert.ToString(F16T10, 2);
        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {
            int F2T10 = Convert.ToInt32((textBox4.Text), 2);
            textBox1.Text = Convert.ToString(F2T10);
            textBox2.Text = Convert.ToString(F2T10, 16);
            textBox3.Text = Convert.ToString(F2T10, 8);
        }
    }
}

Download(Skydrive) : Download

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s