Hello,
I was wondering if an experienced AHK coder would be so kind as to direct me toward documentation regarding ListView function of AHK and what it I can do with it. I have looked online but as usual there are links from "other" forum topics that are either offline or not what I was looking for. I am not new to AHK, but I am new to using ListView and technically I am a noob in that area. I have learned what I know about AHK by asking questions and ACTUALLY implenting what was taught to me.
As it is right now, my project requires how I learn to get individual fields in ListView into Edit box's on a GUI. I learned how to create a ListView box on the GUI and I learned how to populate the ListView from the Edit box on the GUI. So essentially I can populate a ListView but I do not know how to populate the Edit boxes located on the GUI from the ListView. I can get it there but I can't get it back.
Thank you for you help in advance.
Get me pointed in the right direction
Re: Get me pointed in the right direction
Post some code in "Ask for help"
People including me will gladly help you with that.
People including me will gladly help you with that.
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Get me pointed in the right direction
i have an unfortunate amount of experience with list views.
forunately i think the help file gets us very very close lets look closer at LV_GetText(RowText, A_EventInfo) ; Get the text from the row's first field. accepts a 3rd optional parameter of column so if i used LV_GetText(RowText, A_EventInfo, 2) ; Get the text from the row's Second field
ok so now we know how to get a specific column
what about selected and then a button
same example with some additions
forunately i think the help file gets us very very close
Code: Select all
; Create the ListView with two columns, Name and Size:
Gui, Add, ListView, r20 w700 gMyListView, Name|Size (KB)
; Gather a list of file names from a folder and put them into the ListView:
Loop, %A_MyDocuments%\*.*
LV_Add("", A_LoopFileName, A_LoopFileSizeKB)
LV_ModifyCol() ; Auto-size each column to fit its contents.
LV_ModifyCol(2, "Integer") ; For sorting purposes, indicate that column 2 is an integer.
; Display the window and return. The script will be notified whenever the user double clicks a row.
Gui, Show
return
MyListView:
if A_GuiEvent = DoubleClick
{
LV_GetText(RowText, A_EventInfo) ; Get the text from the row's first field.
ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%"
}
return
GuiClose: ; Indicate that the script should exit automatically when the window is closed.
ExitApp
ok so now we know how to get a specific column
what about selected and then a button
same example with some additions
Code: Select all
; Create the ListView with two columns, Name and Size:
Gui, Add, ListView, r20 w700 gMyListView, Name|Size (KB)
Gui, Add, button,section gMyListViewSelectFile, File
Gui, Add, button, section gMyListViewSelectSize, Size
; Gather a list of file names from a folder and put them into the ListView:
Loop, %A_MyDocuments%\*.*
LV_Add("", A_LoopFileName, A_LoopFileSizeKB)
LV_ModifyCol() ; Auto-size each column to fit its contents.
LV_ModifyCol(2, "Integer") ; For sorting purposes, indicate that column 2 is an integer.
; Display the window and return. The script will be notified whenever the user double clicks a row.
Gui, Show
return
MyListViewSelectSize:
column = 2
MyListViewSelectFile:
{
LV_GetText(RowText, LV_GetNext("Selected" ), column) ; Get the text from the row's first field.
ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%"
}
column = 1
return
MyListView:
if A_GuiEvent = DoubleClick
{
LV_GetText(RowText, A_EventInfo) ; Get the text from the row's first field.
ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%"
}
return
GuiClose: ; Indicate that the script should exit automatically when the window is closed.
ExitApp
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: Get me pointed in the right direction
tank, unfortunately, like the other forum, colors don't seem to be working within codeboxes:
tank wrote:Code: Select all
[color=#FF0000]MyListViewSelectSize: column = 2 MyListViewSelectFile: { LV_GetText(RowText, LV_GetNext("Selected" ), column) ; Get the text from the row's first field. ToolTip You double-clicked row number %A_EventInfo%. Text: "%RowText%" } column = 1 return[/color]
Re: Get me pointed in the right direction
Colors inside codeboxes do not work either in the other forum. They used to work, though; but poly broke it by introducing extremely broken PHP syntax highlighting.
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -[My project list]
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 -
Re: Get me pointed in the right direction
Thank you for your responses. I didn't want to start a redundant post in the help section as that would probably frustrate those who moderate the forums.
@Tank: Funny thing is I read the help file. I just didn't fully understand it. Thank you for explaining it to me. I do believe that I understand it better now or at least enough to start implementing for my project. I do believe you may have connected the dots. Thanks again! Is it Ok that I PM as I learn or have questions?
@Tank: Funny thing is I read the help file. I just didn't fully understand it. Thank you for explaining it to me. I do believe that I understand it better now or at least enough to start implementing for my project. I do believe you may have connected the dots. Thanks again! Is it Ok that I PM as I learn or have questions?
Re: Get me pointed in the right direction
Personally, I think it is better to post your questions so that others may learn from them.
Re: Get me pointed in the right direction
wow never noticed ill fix that very soon
I do not respond to PM's for help
keep it in the forum where everyone can learn from it.
the only exceptions i make is if you need to share confidential information via PM
I do not respond to PM's for help
keep it in the forum where everyone can learn from it.
the only exceptions i make is if you need to share confidential information via PM
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: Get me pointed in the right direction
Lol me neither, ... Ok ok... It's true I'm colorblind..
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Get me pointed in the right direction
My friend from high school (like 5+ years ago) is color blind.joedf wrote: It's true I'm colorblind..
Many years ago for his birthday, I bought him a Rubik's cube.
Needless to say, I got punched for that one. Worth it.
Re: Get me pointed in the right direction
You meanie! >:(
Lol good one though, I would have probably done the same haha!
Lol good one though, I would have probably done the same haha!
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Return to “Off-topic Discussion”
Who is online
Users browsing this forum: No registered users and 62 guests