Jump to content

Scrolling to selected item in a list view?

Recommended Posts

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

If i'm using this example:


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


Func _Main()
Local $hListView

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

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

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

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

; Loop until user exits
EndFunc ;==>_Main

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

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...