|
-
June 9th, 1999, 02:25 PM
#1
2 simple CListCtrl questions = )
hi,
actually, i have 2 questions.
1. given an index of an item in a list control (CListCtrl ). how do i highlite it?
i tried:
lvitem.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
lvitem.state = LVIS_SELECTED | LVIS_FOCUSED;
as in my code below
lvitem.mask = LVIF_IMAGE | LVIF_TEXT;
lvitem.iItem = m_cactions_list.GetItemCount();
lvitem.iSubItem = 0;
lvitem.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
lvitem.state = LVIS_SELECTED | LVIS_FOCUSED;
//other item setup here...
lvitem.pszText = key_hit;
actions_list.InsertItem( &lvitem );
i was thinking that it would set foucs/highlite to the last inserted item, but its not working.
2. given an index of an item in a list. how can i move it up or down in the list, ie. change its index?
thank you,
jeremy
-
June 9th, 1999, 03:04 PM
#2
Re: 2 simple CListCtrl questions = )
Well for one thing:
vitem.mask = LVIF_IMAGE | LVIF_TEXT;
will have to be changed to
vitem.mask = LVIF_IMAGE | LVIF_TEXT|LVIF_STATE;
otherwise vitem.state will pretty much be ignored.
-
June 9th, 1999, 03:06 PM
#3
Re: 2 simple CListCtrl questions = )
1) Try changing "lvitem.iItem = m_cactions_list.GetItemCount()" to
"lvitem.iItem = m_cactions_list.GetItemCount() - 1" since iItem is zero based.
2) One of the articles in the Listview control section has a solution to this problem, but I do not remember which one it was.
Lee
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|