September 22, 2019, 09:13:06 pm

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


List view column count

Started by Andy, May 25, 2019, 05:26:02 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

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
Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks Egil,

But that only gives you how many lines in a list view, not how many columns a list view has.

Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks every one!

Here is the answer:

Code Select
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.
 :)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.