The input string has to represent the number in decimal for
Convert.ToInt16(String)[
^] to work.
Its output is an integer. That has neither decimal nor hexadecimal format. It's just the correct value.
You can convert it into a string again to display it to the user. Use
the ToString() method[
^] for that.
If you want the output string to be in hexadecimal format, use
Int16 number = 255;
string output = number.ToString("X");
for that.
If you want to convert a string that represents a number in hexadecimal form to an integer, use
Int16 number;
bool success = Int16.TryParse(
"0xFF",
NumberStyles.HexNumber,
CultureInfo.InvariantCulture,
out value
);