简体   繁体   English

如何在 CListCtrl 中为单个项目加下划线

[英]How to underline individual items in a CListCtrl

We want some items in a CListView to appear like hypertext links.我们希望 CListView 中的某些项目看起来像超文本链接。

I can make everything underlined by setting the lfUnderline flag in LOGFONT, and creating a font from this, before calling SetFont - but this applies to the whole CListView.在调用 SetFont 之前,我可以通过在 LOGFONT 中设置 lfUnderline 标志并从中创建字体来使所有内容加下划线 - 但这适用于整个 CListView。

Does anyone know how to make individual items in a CListView to appear underlined?有谁知道如何使 CListView 中的单个项目显示为下划线?

You can do this by using the custom-draw notifications and modifying the font on the particular item you want within the custom-draw handler.您可以通过使用自定义绘制通知并在自定义绘制处理程序中修改您想要的特定项目的字体来做到这一点。

See this link for details.有关详细信息,请参阅此链接

Try this:尝试这个:

oMyCListView.SetExtendedStyle(LVS_EX_ONECLICKACTIVATE)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM