AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Selecting a row from a Listbox with multiple columns

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
allenyeung24
Guest





PostPosted: Fri Oct 16, 2009 3:55 am    Post subject: Selecting a row from a Listbox with multiple columns Reply with quote

Hi All,

I am trying to select a row in a SysListView321 Listbox based on a string. Problem here is that the listbox has 5 columns and the string that I want to search for is in the fourth column. What is the most efficient way to search for the string and select the row that the string is located on?

Thanks in advance.
Back to top
jethrow



Joined: 24 May 2009
Posts: 722
Location: Iowa, USA

PostPosted: Fri Oct 16, 2009 4:19 am    Post subject: Reply with quote

Here's an option:
Code:
n:=""
SearchString := "" ; enter string
ControlGet, text, List, Col1, SysListView321, A
Loop, Parse, text, `n, `r
   If(A_LoopField=SearchString) {
      n:=A_Index-1
      ControlSend, SysListView321, {Home}{down %n%}, A
      Return
   }

_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group