开发者

How to Change Color of a cell in excel from Silverlight using Com AutomationFactory

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;
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜