Mmm .. I tried it with QueryObject() and it still fails:
For more listbox information have you looked at MSDN Library - ListBoxes ?
Const LB_GETCOUNT=$18b width=400 ; Window client width height=300 ; Window client height gap=20 ; Gap between gadgets hwin=CreateWindow("Testing",100,50,width,height,0,33) lbox=CreateListBox(gap,gap,width-gap*2,height-gap*2,hwin) For d=1 To 5 AddGadgetItem lbox,"Line "+d Next i=SendMessage(QueryObject(lbox,1),LB_GETCOUNT,0,0) AddGadgetItem lbox,"Count = "+Str$(i) WaitEvent End
For more listbox information have you looked at MSDN Library - ListBoxes ?