2011年12月22日 星期四

C# String 轉換成 Color; color轉換成string


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);

沒有留言:

張貼留言