Returning an Index number (SOLVED)

Just starting out? Need help? Post your questions and find answers here.
codeit
User
User
Posts: 62
Joined: Sat Apr 15, 2017 5:53 pm
Location: Leicestershire

Returning an Index number (SOLVED)

Post by codeit »

Sorry for such a silly question but I just can't find the answer anywhere
I am trying to return the Index number of a Listview item when seleted

Code: Select all

  If Count > -1
            Select EventType()
              Case #PB_EventType_LeftClick : Index = GetGadgetItemState(playlist, -1)
                Debug Index
            EndSelect
          EndIf
This just returns 0 all the time any help would be great guys.

Thanks
Last edited by codeit on Thu Jul 20, 2017 9:55 am, edited 1 time in total.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Returning an Index number

Post by wilbert »

I think you can use GetGadgetState instead of GetGadgetItemState if you don't allow for multiple selection.
Windows (x64)
Raspberry Pi OS (Arm64)
codeit
User
User
Posts: 62
Joined: Sat Apr 15, 2017 5:53 pm
Location: Leicestershire

Re: Returning an Index number

Post by codeit »

Thanks for that not sure if when reading the help I saw GetGadgetState and GetGadgetitemState and did not notice both are different.
:mrgreen:
Post Reply