I'm trying to automatically convert a binary input in a textbox to a hex code in a second textbox.
It does work the way I'm trying to, but the order it comes out is wrong, for instance, 1111 = 0F this is correct, but when i now make it :
11111 i get 1F out of it what is of course wrong.
my code is:
private void textBox1_TextChanged(object sender, EventArgs e)
{
string hex;
string hexwaarde;
try
{
hex = textBox1.Text;
hexwaarde = String.Format("{0:X2}", Convert.ToInt32(hex, 2));
textBox2.Text = hexwaarde;
}
catch{}
}
thanks in advance,
NdZ