uint color; bool parsedhex = uint.TryParse(TextBox1.Text, out color); //where Text is of the form 0xFF0000 if(parsedhex) //...
不起作用。我究竟做错了什么?
尝试
Convert.ToUInt32(hex, 16) //Using ToUInt32 not ToUInt64, as per OP comment