listview 换行问题 Topic is solved

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

ahkhome
Posts: 1
Joined: 26 Feb 2024, 02:26

listview 换行问题

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.]
WKen
Posts: 183
Joined: 21 Feb 2023, 00:01

Re: listview 换行问题  Topic is solved

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
}

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 105 guests