Hi Im using AutomationFactory from silverlight to create and manipulate Exel worksheet. And I want to change Color of a cell. If I understand correctly I must change this prop开发者_如何转开发erty
cell.Interior.Color =
However I want to change it to MyObject.Color (whitch is of tzpe Color) MSDN Says i should use RGB function to assign cell.Interior.Color But there is no RGB function in silverlight!? How to change Color to something cell.Interior.Color will understand?
I made RGB function..
internal static int RGB(Color color)
{
string hexaString=color.B.ToString("X2") + color.G.ToString("X2") + color.R.ToString("X2");
int rgb = int.Parse(hexaString, System.Globalization.NumberStyles.HexNumber);
return rgb;
}
精彩评论