如何在wpf画布控件中添加动态设计的用户控件时获取高度和宽度?
您好,我正在开发一个 wpf 应用程序。我正在画布中添加 myUserControl 对象。我需要高度和添加的用户控制。现在的问题是用户控件是动态设计的,我正在创建网格并根据用户配置添加行和列,并且我在高度和宽度上给出自动。所以我在画布中添加用户控件时没有获得用户控件的实际高度和宽度。
Hello I am developing one wpf application. I am adding object of myUserControl in canvas. i need height and with of added usercontrol. Now problem is that user control is design dynamically, i am creating grid and adding row and column according to configured by user, and i am giving auto in height and width. so i am not getting actual height and width of user control while adding it in canvas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从
FrameworkElement
派生的所有 UI 元素都具有ActualWidth
和ActualHeight
属性。All UI elements derived from
FrameworkElement
have theActualWidth
andActualHeight
properties.