ListIcon: How to count how many Columns?

Just starting out? Need help? Post your questions and find answers here.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

ListIcon: How to count how many Columns?

Post by guruk »

something like: amount=CountGadgetColumns (#ListIcon_1)

:)

Hope you have an Idea
chris
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

One way is to ask the header control for the number of items:

Code: Select all

headerhWnd=SendMessage_(GadgetID(1),#LVM_GETHEADER,0,0)
debug sendmessage_(headerhWnd, #HDM_GETITEMCOUNT,0,0)
Regards.
I may look like a mule, but I'm not a complete ass.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Post by guruk »

Great.. Only till now PB dont know what #LVM_GETHEADER is???
and same with: #HDM_GETITEMCOUNT
any idea?
chris
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

The #LVM_GETHEADER message simply retrieves the handle of the header control which is attached to the ListIcon gadget.

The column headings you see in a ListIcon gadget are actually part of a Windows header control which has been bound to the ListIcon. You can use header controls almost anywhere, not just with ListIcons.

Anyhow, the number of columns in a ListIcon is simply the number of items in the attached header control.
I may look like a mule, but I'm not a complete ass.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Post by guruk »

Thanks.. now it works for me
chris
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

In 'MoreListIconGadget'-Lib you find a lot of functions like 'GetColumnsNumber(#Gadget)' and more.
Look at: http://denislabarre.free.fr/Librairies/ ... 201_31.zip
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply