i have a silly question (i hope not)

on a listicongadget i want to know if a line is selected or not. i need to show all of the list. so i define the last line to use. but when i get the state i get always the number of the last line - if selected or not. Do i something wrong? is there another way? or how can i see if nothing or the last is selected?
Code: Select all
If OpenWindow(0, 0, 0, 320, 200, "TEST", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Flags = #PB_ListIcon_FullRowSelect | #PB_ListIcon_GridLines | #LVS_NOCOLUMNHEADER
ButtonGadget(1, 10, 5, 100, 30, "TEST")
ListIconGadget(0, 10, 45, 300, 160, "Column 1", 100, Flags)
For b = 2 To 4
AddGadgetColumn(0, b, "Column " + Str(b), 65)
Next
For b = 0 To 12
AddGadgetItem(0, b, "Item 1"+Chr(10)+"Item 2"+Chr(10)+"Item 3"+Chr(10)+"Item 4")
Next
SetGadgetState(0,CountGadgetItems(0) - 1)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget
If EventGadget() = 0 Or EventGadget() = 1
Debug GetGadgetState(0)
EndIf
EndIf
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
thanks for your help.
Sigi