Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

List view and TAB


  • Please log in to reply
4 replies to this topic
Medioman92
  • Guests
  • Last active:
  • Joined: --
hi, sorry for my english but i'm italian autohotkey coder :D

i got this problem...i made a simple GUI program with 2 TAB
each tab contains a simple list view...

i got some problems with the buttons content in TAB2...

for example

ButtonReset:

LV_Delete()

Return

but...this button reset the list-view in TAB1...not the one in TAB2

how can i solve my simple problem ?


P.S i've already tried to use "Gui, Tab, TAB2" command into the button...but it still working on TAB1 list-view

ton80
  • Members
  • 74 posts
  • Last active: Apr 02 2014 03:51 AM
  • Joined: 18 Dec 2009
you have to identify which listview you are working with. normally the first one is syslistview321, the second is syslistview322, etc. You can find out for sure with windows spy.

to switch between them do this:
Gui,Listview,Syslistview322

so your code should be
ButtonReset:
Gui,Listview,Syslistview322
LV_Delete()
Return


garry
  • Spam Officer
  • 3219 posts
  • Last active: Feb 06 2016 09:32 PM
  • Joined: 19 Apr 2005
another example
;------- 2 TAB ---------------------
Gui, 1: +Resize +LastFound
Gui, 1:Add, Tab, AltSubmit -Wrap , One|Two

Gui, 1:Tab, 1
Gui, 1:Add, ListView, altsubmit gMyListView1 vA1,Tab No|Line No
gosub,filllistview1
Gui,add,button,x30 y150  gT1,TEST1

Gui, 1:Tab, 2
Gui, 1:Add, ListView, altsubmit gMyListView2 vA2,Tab No|Line No
gosub,filllistview2
Gui,add,button,x30 y150  gT2,TEST2

Gui, 1:Show, , Tabs
return
;----------------------------

Filllistview1:
LV_Add("","Tab 1", "Line 1")
LV_Add("","Tab 1", "Line 2")
LV_Add("","Tab 1", "Line 3")
return

Filllistview2:
LV_Add("","Tab 2", "Line 1")
LV_Add("","Tab 2", "Line 2")
LV_Add("","Tab 2", "Line 3")
return
;--------------------------


Guiclose:
exitapp
;--------------------------

T1:
Gui,1:submit,nohide
Gui,1:Listview,A1
msgbox,T1
return


T2:
Gui,1:submit,nohide
Gui,1:Listview,A2
msgbox,T2
return
;---------------------------

MyListView1:
Gui,1:submit,nohide
Gui,1:Listview,A1
if A_GuiEvent = Normal
  {
  LV_Gettext(C1,A_eventinfo,1)
  LV_Gettext(C2,A_eventinfo,2)
  msgbox,C1=%c1%`nC2=%c2%
  }
Return

MyListView2:
Gui,1:submit,nohide
Gui,1:Listview,A2
if A_GuiEvent = Normal
  {
  LV_Gettext(C1,A_eventinfo,1)
  LV_Gettext(C2,A_eventinfo,2)
  msgbox,C1=%c1%`nC2=%c2%
  }
Return
;==========================================


Medioman92
  • Guests
  • Last active:
  • Joined: --
thanks so much...problem solved with syslistview metod...i can't find it in autohotkey manual...maybe someone should add it...

VxE
  • Moderators
  • 3622 posts
  • Last active: Dec 24 2015 02:21 AM
  • Joined: 07 Oct 2006

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 or its ClassNN as shown by Window Spy.