WPF 表格列宽
我有一个流程文档,我在其中以编程方式添加表格。这很好用。但就像在word中一样,我希望能够用鼠标调整列的大小。但我不知道该怎么做。 是否可以将此功能添加到表中? 如果可能的话,有一个例子如何做到这一点?
I have a flowdocument where I add a table programmatically. This works fine. But like in word, I want to be able to resize the column size with the mouse. But I can't figure how to do this.
Is it possible add this feature to a table?
If its possible, is there an example how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信你不能那样做。
ContentElements(表格、段落等)并非旨在订阅任何高度/宽度规范,它们的内容和容器决定它们的大小。
但是你可以在 Margin 和 Padding 绑定上玩点花样来解决这个问题。或者有一个类似的问题可能会有所帮助:WPF 表列大小
I believe you cannot do that.
ContentElements (Tables, Paragraphs, etc.) are not designed to subscribe to any height/width specifications, their content and container determine their size.
But you may play tricks on Margin and Padding binding to go around that. Or there is a similar SO question that may help: WPF Table Column Sizes