how TO CHOOSE a listview from severals?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jasamoron
Posts: 8
Joined: 15 May 2017, 08:10

how TO CHOOSE a listview from severals?

12 Dec 2017, 09:16

Hi,
I have a window with 2 listview, added with "Gui, Add, ListView" command
But I only can manage (LV_Add, LV_Delete()...) the last listview that I have created...

How could i choose the listview that I want manage ?

thanks
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: how TO CHOOSE a listview from severals?

12 Dec 2017, 09:26

https://autohotkey.com/docs/commands/Li ... tm#BuiltIn
If the window has more than one ListView control, by default the functions operate upon the one most recently added. To change this, specify Gui, ListView, ListViewName, where ListViewName is the name of the ListView's associated variable, its ClassNN as shown by Window Spy or [in v1.1.04+] its HWND. Once changed, all existing and future threads will use the indicated ListView. [v1.1.23+]: A_DefaultListView contains the current setting.
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
jasamoron
Posts: 8
Joined: 15 May 2017, 08:10

Re: how TO CHOOSE a listview from severals?

13 Dec 2017, 18:53

Masonjar13 wrote:https://autohotkey.com/docs/commands/Li ... tm#BuiltIn
If the window has more than one ListView control, by default the functions operate upon the one most recently added. To change this, specify Gui, ListView, ListViewName, where ListViewName is the name of the ListView's associated variable, its ClassNN as shown by Window Spy or [in v1.1.04+] its HWND. Once changed, all existing and future threads will use the indicated ListView. [v1.1.23+]: A_DefaultListView contains the current setting.
thanks friend but, how could I use it if my 2 listview is in the SAME WINDOW :roll: :roll: :roll:
jasamoron
Posts: 8
Joined: 15 May 2017, 08:10

Re: how TO CHOOSE a listview from severals?

13 Dec 2017, 19:50

Code: Select all

WINDOW:

Gui, Add, ListView, vlv1 x12 y100 w480 h470 AltSubmit, 1|1|1|1
Gui, Add, ListView, vlv2 x502 y100 w490 h470 AltSubmit, 2|2|2|2
Gui, Add, Button, x722 y620 w50 h30 vbut10 gnext, >>
Gui, Show, x203 y268 h679 w1007, Ventana
return

next:
{
	LV_Delete(), LV1
	cantidad=a
	producto=b
	precio=c
	importe=d
	LV_Add(lv1, cantidad, producto, precio, importe) 
}
return


GuiClose:
ExitApp

ESCAPE::
ExitApp
I would like listview #1 show content but I don't know how use listview's ID
jasamoron
Posts: 8
Joined: 15 May 2017, 08:10

Re: how TO CHOOSE a listview from severals?

13 Dec 2017, 20:00

ok, I get it, here is:

WINDOW:

Gui, Add, ListView, vlv1 x12 y100 w480 h470 AltSubmit, 1|1|1|1
Gui, Add, ListView, vlv2 x502 y100 w490 h470 AltSubmit, 2|2|2|2
Gui, Add, Button, x722 y620 w50 h30 vbut10 gnext, >>
Gui, Show, x203 y268 h679 w1007, Ventana
return

next:
{
;listview id
Gui, ListView, LV1
LV_Delete(),
cantidad=a
producto=b
precio=c
importe=d
LV_Add("", cantidad, producto, precio, importe)
}
return


GuiClose:
ExitApp

ESCAPE::
ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, Google [Bot], mikeyww, TAC109 and 378 guests