开发者

clearing all usercontrol in the wpf window

How to clear all usercontrols in the wpf window. in runtime i added 开发者_JS百科dynamic usercontrols in my wpf window, when i refresh, i want to clear all those and need to load again. so how i can clear all usercontrols in my page.??


The Window class itself has a single child which you can clear by setting the Content property to null. If you added the controls to a Panel, such as a Grid or Canvas, then you can clear them by calling the Clear method on the Children property:

myCanvas.Children.Clear();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜