如何使用win32创建带有复选框的列表框? [英] How to Create Listbox with Checkboxes using win32 ?

查看:546
本文介绍了如何使用win32创建带有复选框的列表框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是win32的新手.我想学习如何在不使用mfc的情况下使用复选框创建所有者绘制列表框.
请提供一些链接或示例代码.

预先感谢.

I am new to win32. I want to learn how to create owner draw listbox with check boxes without using mfc.
Please provide me some links or sample codes.

Thanks in advance.

推荐答案

本机树视图将支持此功能-在创建后将其样式更改为TVS_CHECKBOXES 或附加到它-如果您不添加任何子代,则实际上是一个列表框

然后,您需要在列表框的父级中查看NM_CLICK ,并在父级通知过程中使用TreeView_HitTest TreeView_GetCheckState宏来确定哪个复选框被命中了

如果您是Win32的新手,这将是一个挑战...
The native treeview will support this - change its style to set TVS_CHECKBOXES after you''ve created or attached to it - if you don''t add any children, it''s effectively a listbox

You then need to watch for an NM_CLICK in the parent of the listbox, and use TreeView_HitTest and TreeView_GetCheckState macros in the parent notification procedure to work out which checkbox got hit

if you''re new to win32 it''s going to be challenging ...


检查此内容,
检出,一个简单的Win32 SDK选中的列表框和组合框 [
Check this,
Check It Out, A Simple Win32 SDK Checked Listbox and Combobox[^]

Still, There are lot of articles in the codeproject.


这篇关于如何使用win32创建带有复选框的列表框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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