Jump to content

Scrolling to selected item in a list view?


Recommended Posts

Hello again........... big-minds!

If i'm using this example:

#include 
#include 

Opt('MustDeclareVars', 1)

$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
Local $hListView

GUICreate("ListView Set Item Selected", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState()

; Add columns
_GUICtrlListView_AddColumn($hListView, "Items", 100)

; Add items
For $i = 1 to 100
_GUICtrlListView_AddItem($hListView, "Item " & $i)
Next


; Select item 2
_GUICtrlListView_SetItemSelected($hListView, 40)
MsgBox(4160, "Information", "Item 40 Selected: " & _GUICtrlListView_GetItemSelected($hListView, 40))

; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main

is there any way to scroll to the selected item? _GUICtrlListView_Scroll doesn't help so much! :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...