網上看到這種方法, 趕快記錄下來 免得忘記了
string轉換成color
string col = "#FF8400";
this.BackColor = System.Drawing.ColorTranslator.FromHtml(col);
color轉換成string
Color mycolor = this.BackColor;
string strcol = System.Drawing.ColorTranslator.ToHtml(mycolor);
MessageBox.Show(strcol);
順便外加一種方法
Color.FromName("Red"); 這也是可以直接轉換的