Home Tour! Products Download Purchase Support Company Contacts  

Question

Is there a way for a program to cause the selection of several rows in a ListView, which has multiple-selection and FullRowSelect enabled? I was surprised when I couldn't find a function (method) to do this. I tried multiple calls to SetCurSel and nothing happened. The list view is in the Report style.

Answer

The SetCurSel does indeed work. The problem is caused because the 'ShowSelectionAlways' is set to False. Change it to True and you will be able to force any list item to be selected when the ListView control does not have the current focus.

Home Products Download Purchase Support Company Contacts