List控件的第一列为何不能设置成右对齐?

yzlipeng 2003-09-26 11:12:29
CListCtrl m_kucunlist;
......
m_kucunlist.SetExtendedStyle (LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT|LVS_EX_TWOCLICKACTIVATE);
m_kucunlist.InsertColumn(0,"类别",LVCFMT_RIGHT,60);
m_kucunlist.InsertColumn(1,"编号",LVCFMT_RIGHT,90);
......
其中第一列怎么也无法设置为右对齐,第二列却没有问题,何解?

...全文
39 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
vcforever 2003-09-27
  • 打赏
  • 举报
回复
除了第一列以外,其他的列都可以右对齐!
whoishere 2003-09-26
  • 打赏
  • 举报
回复
第一列的确无法设置为右对齐,这一点在MSDN中有说明,原文如下:
PRB: Column 0 of ListView Control Is Always Left- Aligned
ID: Q193679



--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Win32 Software Development Kit (SDK)
Microsoft Windows 2000

--------------------------------------------------------------------------------


SYMPTOMS
When you are in using a ListView control in report mode, the column with an index value of 0 is always left-aligned. This happens even if the column is added with the LVCFMT_RIGHT or LVCFMT_CENTER styles. Any column inserted at index 0 loses its alignment style and is left-aligned.



STATUS
This behavior is by design. The first column in a report mode ListView control (index 0) is always left-aligned.

Additional query words:

Keywords : kbCtrl kbListView kbWinOS2000 kbSDKPlatform kbSDKWin32 kbGrpUser kbWinOS
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbprb

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧