如何在clistctrl的一个标题下获得两个列 [英] How do i get two colums under one header of clistctrl

查看:69
本文介绍了如何在clistctrl的一个标题下获得两个列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我需要在一个标题下获得两个列。



让我们说我有一个标题名称为Header1,我想要两个列colum1和Colum 2在一个标题下。



我知道怎么能这样做?



问候,

欢乐



我的尝试:



不确定我是否需要在drawItems中编写代码...

解决方案

唯一的解决方案即将到来在我的脑海里是继承 CHeaderCtrl 并为它实现所有者绘图。



因为标题和列表中的列绑在一起,所以标题必须仍然具有相同的列数。在所有者绘制方法中,使用全宽度绘制第一列,并跳过第二列。也可能需要覆盖其他事件处理程序(例如处理点击事件)。



有用的链接可能是使用标题控件 [ ^ ]和 CHeaderCtrl :: DrawItem [ ^ ]。

Hi All,

I need to get two colums under one header.

Lets say I have one header names as Header1, I want two colums as colum1 And Colum 2 under one header.

Any idea how can I do this?

Regards,
Joy

What I have tried:

Not sure if I need to write code in drawItems...

解决方案

The only solution coming into my mind is subclassing the CHeaderCtrl and implementing owner drawing for it.

Because the columns from the header and the list are tied together, the header must still have the same number of columns. Within the owner draw method draw the first column using the full width and skip drawing the second. It may be also necessary to override other event handlers (e.g. to handle click events).

Helpful links might be Using the Header Control[^] and CHeaderCtrl::DrawItem[^].


这篇关于如何在clistctrl的一个标题下获得两个列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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