uint color; bool parsedhex = uint.TryParse(TextBox1.Text, out color); //where Text is of the form 0xFF0000 if(parsedhex) //...
doesn't work. What am i doing wrong?
Try
Convert.ToUInt32(hex, 16) //Using ToUInt32 not ToUInt64, as per OP comment
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With