0

Possible Duplicates:
Convert a string containing a hexadecimal value starting with “0x” to an integer or long in C#
How to parse hex values into a uint?

I have a textbox that can have "0xFFFF" in it's Text property. I need to convert it to an int32.

How do I do that? I have tried:

Int32.Parse( MyTextBox.Text, NumberStyles.HexNumber )

and

Int32.Parse( MyTextBox.Text, NumberStyles.AllowHexSpecifier)

and get the following error message:

"Input string was not in a correct format."

Please help!

Community
  • 1
  • 1
BeYourOwnGod
  • 2,345
  • 7
  • 30
  • 35

1 Answers1

0

take off the 0x and just parse the actual hex number.

The Lazy Coder
  • 11,560
  • 4
  • 51
  • 69