开发者

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

开发者 https://www.devze.com 2023-02-28 01:22 出处:网络
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

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

精彩评论

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

关注公众号