Jump to content
  • Advertisement
Sign in to follow this  
Daniel Miller

Is there a Windows control...

This topic is 4875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a control whose size can be increased and decreased (like a ListBox), but that you can put CheckBoxes inside of it? In other words, is there a control like a ListBox that can include a CheckBox with each item?

Share this post


Link to post
Share on other sites
Advertisement
A little poking around with Spy++ seems to indicate it's common to use a listview (not listbox) control to do this. It should be relatively easy to hack the icon associated in with each item to act like a checkbox.

Share this post


Link to post
Share on other sites
from MSDN:

Quote:
EXTENDED LISTVIEW styleS:

LVS_EX_CHECKBOXES

Version 4.70. Enables check boxes for items in a list view control. Effectively, when set to this style, the control will create and set a state image list usingDrawFrameControl. Check boxes are visible and functional with all list view modes. The state of the check box for a given item is obtained using the ListView_GetCheckState macro.
Note: To set the state of the item checkbox, use the following macro.

#ifndef ListView_SetCheckState
#define ListView_SetCheckState(hwndLV, i, fCheck) ListView_SetItemState(hwndLV, i, INDEXTOSTATEIMAGEMASK((fCheck)+1), LVIS_STATEIMAGEMASK)
#endif

Share this post


Link to post
Share on other sites
For the record, you could also subclass the control and make it do whatever you want it to do. I have a custom listview that acts like a excell sheet - you can press any cell and it temporarily creates a editbox which enables you to enter information. In short, subclassing is good to know about.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!