<pre><code>uint color; 
bool parsedhex = uint.TryParse(TextBox1.Text, out color); 
//where Text is of the form 0xFF0000
if(parsedhex)
   //...
</code></pre>

<p>doesn't work. What am i doing wrong?</p>

Try
```
```
Convert.ToUInt32(hex, 16)  //Using ToUInt32 not ToUInt64, as per OP comment
```
```