Select first ListViewGadget row?

Just starting out? Need help? Post your questions and find answers here.
User avatar
ssg_mick
User
User
Posts: 10
Joined: Thu Oct 26, 2017 12:13 pm

Select first ListViewGadget row?

Post by ssg_mick »

Hi,

how can i select the first row of an ListViewGadget?

I tried SetGatgetItemState(myListViewGadget, 0, 1) but no row is selected.

Mick
Michael

Windows 10, PureBasic 5.70 LTS
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4946
Joined: Sun Apr 12, 2009 6:27 am

Re: Select first ListViewGadget row?

Post by RASHAD »

Code: Select all

 If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ListViewGadget(0, 10, 10, 250, 120,#PB_ListView_MultiSelect)
    For a = 1 To 12
      AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview") ; define listview content
    Next
    SetGadgetItemState(0,0,1) ; set (beginning with 0) the tenth item as the active one
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Egypt my love
User avatar
mk-soft
Always Here
Always Here
Posts: 6207
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Select first ListViewGadget row?

Post by mk-soft »

SetGadgetState(0, 0)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply