AutoHotkey Community

It is currently May 27th, 2012, 5:18 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: January 9th, 2011, 12:07 am 
Offline

Joined: March 8th, 2008, 11:36 am
Posts: 64
Location: Santa Barbara
I have a populated ListView, and I would now like to display, say line 7. That is, scroll so line 7 is in view and highlighted. How would I do that?
Code:
Gui, Add, ListView, r5 vMyListView, File
LV_Add("", "File1" )
LV_Add("", "File2" )
LV_Add("", "File3" )
LV_Add("", "File4" )
LV_Add("", "File5" )
LV_Add("", "File6" )
LV_Add("", "File7" )
LV_Add("", "File8" )
LV_Add("", "File9" )
Gui, Show
return

GuiClose:     ; Indicate that the script should exit automatically when the window is closed.
ExitApp
Esc::ExitApp  ; Press ESC to cancel this script. Placed after the ExitApp.

_________________
http://www.autohotkey.net/~deleyd/xprxm ... amples.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2011, 12:48 am 
Offline

Joined: June 12th, 2009, 11:36 pm
Posts: 1173
Location: Indianapolis IN, USA
I don't use LV's much, but found this in the documentation under ListViews.

Code:
LV_Modify(7, Focus)


Try something like that?

_________________
www.AutoHotkey.net/~Eedis
I love my wife and daughter so much.
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2011, 1:01 am 
Offline

Joined: March 8th, 2008, 11:36 am
Posts: 64
Location: Santa Barbara
Hmm, doesn't seem to work.

_________________
http://www.autohotkey.net/~deleyd/xprxm ... amples.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2011, 1:03 am 
Offline

Joined: March 8th, 2008, 11:36 am
Posts: 64
Location: Santa Barbara
OK getting closer, put "focus" in quotes. Now row has dotted line around it, but isn't scrolled into view.
Code:
LV_Modify(7, "Focus")

_________________
http://www.autohotkey.net/~deleyd/xprxm ... amples.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2011, 1:06 am 
Offline

Joined: March 8th, 2008, 11:36 am
Posts: 64
Location: Santa Barbara
OK got it. Thanks for getting me close enough we found it.
Code:
LV_Modify(7, "Select")
LV_Modify(7, "Vis")

_________________
http://www.autohotkey.net/~deleyd/xprxm ... amples.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2011, 1:12 am 
Offline

Joined: June 12th, 2009, 11:36 pm
Posts: 1173
Location: Indianapolis IN, USA
No problem. I used to use ListView, but I never had to do that before.

_________________
www.AutoHotkey.net/~Eedis
I love my wife and daughter so much.
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], HotkeyStick, XstatyK, Yahoo [Bot] and 76 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group