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 

modify ListView

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



Joined: 12 Feb 2008
Posts: 50

PostPosted: Fri Aug 15, 2008 6:52 pm    Post subject: modify ListView Reply with quote

I like to LV_Modify listview column but only after 6 entrys have been added. How? it adds the vertical scrollbar which is not included in the initial full width which then makes wider than is necessary. When i LV_Modify to another width it looks right with the scrollbar. If i make the initial Listview less wider it doesnt look good. When it lists 6+ listings a horizontal scrollbar appears. If i then LV_ModifyCol it then looks correct.

Code:
Gui, Listview, LV
LV_Delete()
Loop, %file%\*.txt*

LV_Add("", A_LoopFileName)
LV_ModifyCol(1, 120, "File")
return


I like to LV_ModifyCol(1, 120, "File") after the 6th entry one time.


Last edited by markreflex on Fri Aug 15, 2008 7:33 pm; edited 5 times in total
Back to top
View user's profile Send private message
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Fri Aug 15, 2008 7:03 pm    Post subject: Reply with quote

While populating from a text file, keep a count... put:

Code:
If Count >= 6
Change the width


Last edited by Sivvy on Fri Aug 15, 2008 7:07 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
markreflex



Joined: 12 Feb 2008
Posts: 50

PostPosted: Fri Aug 15, 2008 7:06 pm    Post subject: Reply with quote

i added the code above. It populated from a directory listing.
Back to top
View user's profile Send private message
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Fri Aug 15, 2008 7:10 pm    Post subject: Reply with quote

Not to mention, I think your loop is wrong...

Code:
Loop, %file%\*.txt

It needs to be the word "Loop", then either a number or a command (I assume you want "Read") after.
Back to top
View user's profile Send private message MSN Messenger
markreflex



Joined: 12 Feb 2008
Posts: 50

PostPosted: Fri Aug 15, 2008 7:22 pm    Post subject: Reply with quote

It work but i missed off * so it should be
Code:

Loop, %file%\*.txt*

corrected in first post...

in the help under Loop files and folders. You can have variables straight after the Loop.

http://www.autohotkey.com/docs/commands/LoopFile.htm

maybe you thinking from populating from a text file. i still need to modify after 6th filename entry from dir listing...
Back to top
View user's profile Send private message
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Fri Aug 15, 2008 7:37 pm    Post subject: Reply with quote

Your right... I thought you meant reading from a text file.

Code:
Gui, Listview, LV
LV_Delete()
Count = 0
Loop, %file%\*.txt*
{
    Count++
    LV_Add("", A_LoopFileName)
}
If Count >= 6
    LV_ModifyCol(1, 120, "File")
return
Back to top
View user's profile Send private message MSN Messenger
markreflex



Joined: 12 Feb 2008
Posts: 50

PostPosted: Fri Aug 15, 2008 8:23 pm    Post subject: Reply with quote

thanks alot if that works. can't check now.
Back to top
View user's profile Send private message
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Fri Aug 15, 2008 8:35 pm    Post subject: Reply with quote

Hopefully...
Back to top
View user's profile Send private message MSN Messenger
markreflex



Joined: 12 Feb 2008
Posts: 50

PostPosted: Tue Sep 02, 2008 1:25 am    Post subject: Reply with quote

I was going to try with A_Index somehow but yours works a treat! Thanks Sivvy.
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