Issue with background colour

Hi,

I have yet another issue with the component. I’m trying to set the background of a cell but it has no effects at all. The cell also contains text of which I set the foreground to a specific colour and this works fine.

_AsposeWs.Cells(rowCount, colCount).PutValue(favCellText)

//Works fine :
_AsposeWs.Cells(rowCount, colCount).Style.Font.Color = _asposeWb.Colors(_hColorIndexes(strColour))

//Doesn’t work :
_AsposeWs.Cells(rowCount, colCount).Style.Pattern = BackgroundType.Solid
_AsposeWs.Cells(rowCount, colCount).Style.BackgroundColor = Color.Yellow

If I debug it, I can see that the Alpha component of the colour is 0, which may explain why I can’t see the background colour… In this case, how do I set the alpha layer to be 255 ?

Thanks

Hi,

Thank you for considering Aspose.

For Style.Pattern = Solid, please use Style.ForegroundColor instead of Style.BackgroundColor (it will not be applied in case of Solid Pattern).

BackgroundColor is basically the Cells Fill Color and Foreground color is the outline color. If you use some other pattern than solid, you will see that BackgroundColor will fill the Cell and on top of that background color the ForegroundColor will be used as outline color for the pattern. As per the case of Solid Pattern, the Foreground Color will completely fill the cell, so Background color is not required.

Thank You & Best Regards,