如何设置CMFCPropertyListCtrl的列宽? [英] How to set a CMFCPropertyListCtrl's column width?

查看:183
本文介绍了如何设置CMFCPropertyListCtrl的列宽?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在向CMFCPropertyGridCtrl类型的对象添加属性,如下所示:

I'm adding properties to an object of type CMFCPropertyGridCtrl like this:

myPropertyListCtrl.AddProperty(
    new CMFCPropertyGridProperty(
        _T("Name"),
        foo.GetName())
);

结果是只有第二列可见,而第一列不应该包含名称".

The result is that only the second column is visible but not the first that should contain "Name".

  • 我找到了CMFCPropertyGridCtrl::GetPropertyColumnWidth(),但是似乎没有相应的Set...方法...
  • 我查看了NewControls示例,其中的列大小似乎是全自动的.但是,我找不到与我的代码有关的差异.
  • I found CMFCPropertyGridCtrl::GetPropertyColumnWidth() but there appears to be no corresponding Set... method...
  • I looked at the NewControls sample, in which the column sizing appears to be fully automatic. However, I couldn't find the relevant difference to my code.

我想念什么?

推荐答案

m_nLeftColumnWidthCMFCPropertyGridCtrl类的protected成员,负责保持"Name"列的宽度.创建您自己的类,该类派生自CMFCPropertyGridCtrl,您将可以操纵m_nLeftColumnWidth.

m_nLeftColumnWidth responsible for holding the "Name" column's width is a protected member of the CMFCPropertyGridCtrl class. Create your own class, that derives from CMFCPropertyGridCtrl and you will be able to manipulate m_nLeftColumnWidth.

这篇关于如何设置CMFCPropertyListCtrl的列宽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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