listview 换行问题

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: listview 换行问题

Re: listview 换行问题

Post by WKen » 26 Feb 2024, 14:55

Code: Select all

#Requires AutoHotkey v2

F3::
{
	MyGui := Gui()
	MyGui.Opt("+Resize")

	;UniqueID :=WinGetControls("A")
    Controls := WinGetControlsHwnd("A")

	GuiCtrl := MyGui.Add("ListView", "Checked  r600 w700", ["hwnd"])

	if (!Controls.length)
		return ToolTip("The active window has no controls.")

	for ClassNN in Controls
		GuiCtrl.Add("",ClassNN)

	GuiCtrl.ModifyCol() 
	MyGui.Show
	return
}

listview 换行问题

Post by ahkhome » 26 Feb 2024, 02:38

Code: Select all

MyGui := Gui()

MyGui.Opt("+Resize")
UniqueID :=WinGetControls("A")

GuiCtrl := MyGui.Add("ListView", "Checked  r600 w700", ["hwnd"])

 Controls := WinGetControlsHwnd(UniqueID)


  ControlList := ""
        for ClassNN in Controls
            ControlList .= ClassNN . "`n"
        if (ControlList = "")
            ToolTip "The active window has no controls."
        else
            GuiCtrl.Add("",ControlList  )

GuiCtrl.ModifyCol() 
MyGui.Show
return

运行之后,listview 只有一行。如何增加换行符呢,谢谢。

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
[Mod edit: Moved topic from 'Ask for Help (v2)' to Chinese help subforum because of the used language. Please use English in the main forums.]

Top