如何将用户控件添加到画布 [英] how to add a user control to a canvas

查看:156
本文介绍了如何将用户控件添加到画布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将用户控件添加到画布。

i尝试了这个:



How to add a user control to a canvas.
i tried this:

usercontrol usrcntrl=new usercontrol();
canvas.childre.add(usrcntrl1);



但它不起作用;


but its not working;

推荐答案

如何对动态插入-A-用户控制到-A-XAML的帆布 [<一个HREF =http://social.msdn.microsoft.com/Forums/vstudio/en-US/5ee7254a-b26b-4c55-af4b-416ddbfd208b/how-to-dynamically-insert-a-user-control-onto-a -xaml-canvastarget =_ blanktitle =New Window> ^ ]



希望它会有所帮助..
how-to-dynamically-insert-a-user-control-onto-a-xaml-canvas[^]

Hope it will help..


不确定你的问题...但是如果你想设置uc的顶部和左边......那么





Canvas.SetTop(uc,10)

Canvas.SetLeft(uc,10)
Not sure what your question ... but if you wish to set the top and left of "uc" ... then


Canvas.SetTop(uc,10)
Canvas.SetLeft(uc,10)


这篇关于如何将用户控件添加到画布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆