NumberStyles
is a bit esoteric but it's how you do it:
int offset = int.Parse(textBox10.Text, System.Globalization.NumberStyles.HexNumber);
int offset2 = offset / 2;
textBox11.Text = String.Format("{0:X}", offset2);
Of course, you might need more processing and validation of the user input. Look at int.TryParse
and different int sizes (e.g. Int64
), too.