Re: [DOTNET] Convert Hex to Decimal

2002-05-07 Thread Powell, Simon
Thanks for your help. Simon -Original Message- From: Richard Birkby [mailto:[EMAIL PROTECTED]] Sent: 07 May 2002 12:09 To: [EMAIL PROTECTED] Subject: Re: [DOTNET] Convert Hex to Decimal UInt32 MyInt=System.UInt32.Parse(textBox1.Text, NumberStyles.HexNumber); Richard > -Origi

Re: [DOTNET] Convert Hex to Decimal

2002-05-07 Thread Simon Robinson
You need to call uint.Parse(): uint i = uint.Parse(textBox1.Text, System.Globalization.NumberStyles.AllowHexSpecifier); Note that this method expects the plain number - eg. "20" will convert to 32, while "0x20" will throw an exception so you will want to check and strip off any leading "0x" f

Re: [DOTNET] Convert Hex to Decimal

2002-05-07 Thread Richard Birkby
UInt32 MyInt=System.UInt32.Parse(textBox1.Text, NumberStyles.HexNumber); Richard > -Original Message- > From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of > Powell, Simon > Sent: 07 May 2002 11:07 > To: [EMAIL PROTECTED] > Subject: [DOTNET] Convert Hex t

[DOTNET] Convert Hex to Decimal

2002-05-07 Thread Powell, Simon
Hi, I have a text box that excepts a hex value. How do I then convert to uint32 to pass to an API? Below is a code snippet: private void button1_Click(object sender, System.EventArgs e) { if(this.textBox1.Text == "") {