ListBox
-
How to add check mark in front of selected item in listbox in MFC.. Can anyone help me how to do this.. Thanks..
-
No sir, CCheckListbox will show the check box in front of every item, but I want to put check mark only in the front of selected item, rest of the items shoud not hv check box.
-
If it's your owner drawn list box with the hover effect, you can just paint the check mark in your DrawItem() method. Otherwise I'm afraid you will have to create yet another owner drawn list box class.
-
ya its my ownerdraw list box.. but I don't know how t oremove rest of check boxes on paint. Could u please send me some sample code or some more hnt how to do.. Thanks..
I would probably try to derive my class from a non-checkbox control to avoid all checkboxes in the first place. Then, paint a check box and maintain the checked state myself. Are you going to use the checkbox as a selection indicator only, or does it have any other purpose?
-
I would probably try to derive my class from a non-checkbox control to avoid all checkboxes in the first place. Then, paint a check box and maintain the checked state myself. Are you going to use the checkbox as a selection indicator only, or does it have any other purpose?
it doesn't hv any purpose. the only thing is that it make difference between the item which is already selected and the item which have the focus. I mean If "A" is already selected and my mouse is on "B" then "A" shoud hv check mark and "B " hv background color in back.
-
it doesn't hv any purpose. the only thing is that it make difference between the item which is already selected and the item which have the focus. I mean If "A" is already selected and my mouse is on "B" then "A" shoud hv check mark and "B " hv background color in back.
Well, then just paint a check mark (or whatever icon you'd like) in the beginning of the row if the item is selected. Edit: Another way of dealing with this is to use the font and change it to be underlined when hovered. That way the selection problem goes away.