Your code and description is not enough. Please specify if this is a WinForm or a WebForm project. What is "this" in your code sample - is it the shape whose fill style you want to change? Also make sure whether your "IF" condition comes true at some point. Because if it is always false, then the NStyle.SetFillStyle method will never be executed and the fill style won't be set.