Bei einer ListView feste Zeilennr. einfügen

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Bei einer ListView feste Zeilennr. einfügen

Re: Bei einer ListView feste Zeilennr. einfügen

Post by KHA » 26 Aug 2019, 08:46

vielen Dank, Hubert
Genau, das sollte es machen.

Re: Bei einer ListView feste Zeilennr. einfügen

Post by hd0202 » 26 Aug 2019, 08:06

Ich weiß nicht, ob ich deinen Wunsch richtig verstanden habe, zumal deine Testdaten alle gleich sind und eine neue Sortierung nicht erkennen lassen.
Deshalb hier mein Vorschlag:

Code: Select all

data =
(
Name, Extension1, Locationc
Name, Extension4, Locationa
Name, Extension8, Locationg
Name, Extension3, Locationk
Name, Extension2, Locationu
Name, Extension5, Locationd
Name, Extension7, Locationf
Name, Extension6, Locationb
)
Gui, add, listview, w300 r10 gsorted, Nr.|Name|Extension|Location
Gui, show
loop, parse, data, `n
{
    x :=[]
    loop, parse, A_LoopField, CSV
        x.Insert(A_LoopField)
    LV_Add("", a_index, x*)
    ind := a_index
}
LV_ModifyCol()
return

sorted:
if (a_guievent = "colclick")
{
	loop, % ind
		lv_modify(a_index, 1, a_index) 
}
;msgbox, % a_gui " - " a_guicontrol " - " a_guievent " - " a_eventinfo
return
Hubert

Bei einer ListView feste Zeilennr. einfügen

Post by KHA » 25 Aug 2019, 17:17

Hallo,
wie kann man bei einer Listview, feste Zeilennummer einfügen, d.h. man soll die Spalten 2,3.. usw. sortieren, aber Spalte1 bleibt unverändert. Also, 1,2,3,..

vielen Danke und vielen Gruß im Vorraus.

Code: Select all

data =
(
Name, Extension, Location
Name, Extension, Location
Name, Extension, Location
Name, Extension, Location
Name, Extension, Location
Name, Extension, Location
Name, Extension, Location
Name, Extension, Location
)
Gui, add, listview, w300 r10 , Name|Extension|Location
Gui, show
loop, parse, data, `n
{
    x :=[]
    loop, parse, A_LoopField, CSV
        x.Insert(A_LoopField)
    LV_Add("", x*)
}
LV_ModifyCol()
return

Top