禁用 GridViewColumn 调整大小 [英] Disable GridViewColumn Resize

查看:19
本文介绍了禁用 GridViewColumn 调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在 WPF 中禁用 GridViewColumn 调整大小?我不想为控件设置样式.

Is there any way by which I can disable GridViewColumn resize in WPF? I don't want to style the control.

推荐答案

请参阅此链接:ListView 中的固定宽度列:无法调整大小的列

固定宽度的列是不能用鼠标调整大小的列拖动或双击.您可以在 Outlook 中找到实例.目前可以使用两种方法来达到效果.一是要重新设计 GridViewColumnHeader 以移除其内部的抓手模板.另一种是子类化 GridViewColumn 以限制列'宽度为固定大小.

A fixed-width column is a column that cannot be resized by mouse dragging or double-clicks. You can find instances in outlook. Currently two methods can be used to achieve the effect. One is to restyle GridViewColumnHeader to remove the gripper inside its Template. The other is to subclass GridViewColumn to restrict columns' width to a fixed size.

这篇关于禁用 GridViewColumn 调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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