有什么方法可以使用鼠标拖动/调整画布大小吗?
我使用的画布中嵌入了扩展器,这样当扩展器展开时,它将覆盖下面的控件。
<Canvas Grid.Row="0" Panel.ZIndex="99">
<Border Width="450" BorderThickness="1">
<Expander etc />
</Border>
</Canvas>
<OtherControls Grid.Row="1"/> etc
有没有办法让用户拖动画布的大小,而不是设置画布的大小?
I am using a canvas with an Expander embedded within it, so that when the expander is expanded, it will overlay the controls below.
<Canvas Grid.Row="0" Panel.ZIndex="99">
<Border Width="450" BorderThickness="1">
<Expander etc />
</Border>
</Canvas>
<OtherControls Grid.Row="1"/> etc
Instead of setting the size of the canvas, is there a way to allow the user to drag size it instead?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有一个想法:将所有内容放入网格中。让网格自动调整大小,将画布放入网格中(确保它占据整个网格),以便它遵循父级的大小:
不确定这可能有多相关,但请查看这篇文章。也许它会给你一些想法(我四年前写的,太长了,记不清具体细节,但代码可以编译并运行):
http://denismorozov.blogspot.com/2008/01/how-to-resize-wpf-controls-at-runtime.html
here's a thought: Put everything in the grid. Let the grid resize itself automatically, put canvas in the grid (make sure it takes up the whole grid) so that it will follow the parent's size:
not sure how relevant this might be, but check out this post. Maybe it'll give you some ideas (I wrote that 4 years ago, way too long to remember specifics, but code compiles and runs):
http://denismorozov.blogspot.com/2008/01/how-to-resize-wpf-controls-at-runtime.html