help with a insert object: item,key,value in list GUI

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
ibieel
Posts: 216
Joined: 17 Oct 2021, 23:30

help with a insert object: item,key,value in list GUI

Post by ibieel » 29 Jan 2022, 00:30

hey guys, could anyone give me GUI examples that insert objects,item,key,value into a list.

what I have the most difficulty is in creating the "Button" script to add the variables to the list.

something more or less like this:
image.png
image.png (18.43 KiB) Viewed 356 times

Code: Select all

#SingleInstance, Force
Gui +AlwaysOnTop


; Create the ListView with two columns, Name and Size:
Gui, Add, ListView, r20 w300 h300 gMyListView, Name|Size (KB)
Gui,Add,Text, w180 h20,INSERT NEW ITEM ON LIST:
Gui, Add, Edit, w150 h20, Name
Gui, Add, Edit, w150 h20, Size
Gui,Add,Button, w80 h20, ADD
; 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, Center w700 h450 ,
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

amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: help with a insert object: item,key,value in list GUI

Post by amateur+ » 29 Jan 2022, 04:01

Here were examples for ListBox:
viewtopic.php?p=440899#p440899
viewtopic.php?p=440777#p440777
I'm sure you could find a lot of examples using "site:AutoHotkey.com" in google search.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.

Post Reply

Return to “Ask for Help (v1)”