Nevron Forum

change shape fill style

https://www.nevron.com/Forum/Topic8235.aspx

By Daniela Rybarova - Wednesday, October 9, 2013

I want change shape.Style.FillStyle after click on a toolbar in my application.
I will change shape.Style.FillStyle in some function and:

* when the window with the nDrawingView is maximized, the shape.Style.FillStyle is changed correctly

* but when the window is not maximized the shape.Style.FillStyle is changed only after the mouse cursor is in the window with nDrawingView.

Where is the problem?
By Nevron Support - Friday, October 11, 2013

Hi,

The problem is that you do not refresh the drawing view after you change the fill style of the shape. You should call the SmartRefreshAllViews method of the drawing document in order to do so:

NStyle.SetFillStyle(shape, new NColorFillStyle(KnownArgbColorValue.Red));

document.SmartRefreshAllViews();

By Daniela Rybarova - Tuesday, October 15, 2013

It works, thank you very much.

Originally, I used: shape.Style.FillStyle = new NColorFillStyle(fillColor); nDrawingView.SmartRefresh();
and it had the problem described above.