gpt4 book ai didi

winapi - 防止调整 ListCtrl 中第一列的大小(ReportView)

转载 作者:行者123 更新时间:2023-12-01 22:14:52 24 4
gpt4 key购买 nike

我来自thisLVCFMT_FIXED_WIDTH这种格式样式有效,但仅在第一列之后。第一列项目始终是可移动的。为什么?我是否遗漏了什么?

for(int i = 0; i<NUM_COLUMNS; i++)
{
m_ListCtrl.InsertColumn(i,_gszColumnLabel[i], _gnColumnFmt[i] | LVCFMT_FIXED_WIDTH, _gnColumnWidth[i], -1);
}

最佳答案

第一列is special出于某种原因:

If a column is added to a list-view control with index 0 (the leftmost column), it is always LVCFMT_LEFT. Setting other flags on column 0 does not override that alignment. Therefore if you keep inserting columns with index 0, the text in all columns are left-aligned. If you want the first column to be right-aligned or centered you can make a dummy column, then insert one or more columns with index 1 or higher and specify the alignment you require. Finally delete the dummy column.

也许虚拟列技巧也适用于您的情况?

关于winapi - 防止调整 ListCtrl 中第一列的大小(ReportView),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46707287/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com