|
-
September 3rd, 1999, 06:30 AM
#1
Still trying to highlight a ListCtrl
I have a listctrl within my dialog box, yet have tried many times to highlight the first item in the list ( index 0 ).
I place the functions in the OnInitdialog part of my code,yet still i have had no success.
I have currently tried
m_List.SetItemState( 0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
m_List.EnsureVisible( 0, FALSE);
Someone please tell me what I am doing wrong.
-
September 3rd, 1999, 06:46 AM
#2
Re: Still trying to highlight a ListCtrl
The first line you wrote is correct and sufficient... Did you use this function before the call to the parent OnInitiDialog ? You should perhaps also check the 'Show selection always' check box in the properties of the resource.
-
September 3rd, 1999, 07:46 AM
#3
Re: Still trying to highlight a ListCtrl
I have called the function within the OnInitDialog, just after all of the m_List.InsertItem calls.
I have also checked the properties box, and the show always selection is ticked.
However it still wont highlight. The text colour is black, and the background colour is light blue. If i click on one of the items in the list when running the program it highlights yellow. However it will not highlight the first item initially. Do you have any ideas ?
Many Thanks
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
|