| View previous topic :: View next topic |
| Author |
Message |
markreflex
Joined: 12 Feb 2008 Posts: 50
|
Posted: Fri Aug 15, 2008 6:52 pm Post subject: modify ListView |
|
|
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 |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Fri Aug 15, 2008 7:03 pm Post subject: |
|
|
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 |
|
 |
markreflex
Joined: 12 Feb 2008 Posts: 50
|
Posted: Fri Aug 15, 2008 7:06 pm Post subject: |
|
|
| i added the code above. It populated from a directory listing. |
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Fri Aug 15, 2008 7:10 pm Post subject: |
|
|
Not to mention, I think your loop is wrong...
It needs to be the word "Loop", then either a number or a command (I assume you want "Read") after. |
|
| Back to top |
|
 |
markreflex
Joined: 12 Feb 2008 Posts: 50
|
Posted: Fri Aug 15, 2008 7:22 pm Post subject: |
|
|
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 |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Fri Aug 15, 2008 7:37 pm Post subject: |
|
|
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 |
|
 |
markreflex
Joined: 12 Feb 2008 Posts: 50
|
Posted: Fri Aug 15, 2008 8:23 pm Post subject: |
|
|
| thanks alot if that works. can't check now. |
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Fri Aug 15, 2008 8:35 pm Post subject: |
|
|
| Hopefully... |
|
| Back to top |
|
 |
markreflex
Joined: 12 Feb 2008 Posts: 50
|
Posted: Tue Sep 02, 2008 1:25 am Post subject: |
|
|
| I was going to try with A_Index somehow but yours works a treat! Thanks Sivvy. |
|
| Back to top |
|
 |
|