Hi,
Yes I'm still here!
I was wondering how I can count the number of columns a list view has?
Can this be done any one?
Thanks,
Andy.
Hi Andy,
According to the IWB Users Guide this is the way to do it:
Quotecount = CONTROLCMD( window | dialog, ID, @LVGETCOUNT)
Use this function to retrieve the total number of items in the list view control
Good luck!
Egil
Thanks Egil,
But that only gives you how many lines in a list view, not how many columns a list view has.
Andy.
:)
Sorry andy,
Did not read your questiopn properly....
These two links should give you an idea how to do it:
https://stackoverflow.com/questions/33281164/how-to-get-the-number-of-columns-in-a-list-control (https://stackoverflow.com/questions/33281164/how-to-get-the-number-of-columns-in-a-list-control)
https://www.codeguru.com/cpp/controls/listview/columns/article.php/c997/Getting-the-number-of-columns-in-the-report-view.htm (https://www.codeguru.com/cpp/controls/listview/columns/article.php/c997/Getting-the-number-of-columns-in-the-report-view.htm)
Good luck!
Egil
Thanks every one!
Here is the answer:
uint hProgress = GETCONTROLHANDLE(WinIn,LV) 'Handle to the List view control.
UINT HDR=SendMessage(hProgress,LVM_GETHEADER,0,0) 'Handle to the List view header.
INT Columns=SendMessage(HDR,HDM_GETITEMCOUNT,0,0) 'Number of columns in the List view.
Andy.
:)