March 28, 2024, 06:39:44 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


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:

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.