by garry » 06 Dec 2020, 05:02
a Listbox example ( ? )
or maybe ask also in english forum
Code: Select all
;- 如何获取control为listbox里的其中一项
;- https://www.autohotkey.com/boards/viewtopic.php?f=27&t=84048
;modified=20201209 added 2 buttons/guicontrol
;created =20201206
#warn
#NoEnv
SendMode, Input
SetWorkingDir, %A_ScriptDir%
Gui,2: -dpiscale
GUI,2:+AlwaysOnTop
Gui,2: Color,Black, Black
Gui,2: Font,s14 CGray,Lucida Console
Gui,2:Add, ListBox, x5 y10 w1180 h300 cYellow gRun1 vLB1a
Gui,2:add,button , x10 y330 w250 h35 gA1,URL-LINKS
Gui,2:add,button , x280 y330 w300 h35 gA2,Desktop-LINKS
GUI,2:show, NA W1200 H400 X20 Y10,Test
gosub,a1
return
;----------------------------------------------------------
2GuiClose:
ExitApp
;-----------------
Run1:
Gui,2: Submit, Nohide
try
run,%lb1a%
return
;-------------------------
a1:
e2:="
(Ltrim join|
http://www.xinhuanet.com/english/2020-11/14/c_139516497.htm
http://www.xinhuanet.com/
https://www.theguardian.com/
https://www.dr.dk/radio/
https://news.google.com/news/headlines?hl=nl
http://thesciencepost.com/
"
)
GuiControl,2:,LB1a,|
GuiControl,2:,LB1a,%e2%
return
;-------------------------
a2:
GuiControl,2:,LB1a,|
fd1=%a_desktop%
e:=""
Loop, Files, %fd1%\*.*,D ;- desktop folders
e .= A_LoopFileFullPath . "|"
;Loop, Files, %fd1%\*.lnk , R ;- desktop *.lnk ( links )
; e .= A_LoopFileFullPath . "|"
GuiControl,2:,LB1a,%e%
return
;===============================================================
a Listbox example ( ? )
or maybe ask also in english forum
[code]
;- 如何获取control为listbox里的其中一项
;- https://www.autohotkey.com/boards/viewtopic.php?f=27&t=84048
;modified=20201209 added 2 buttons/guicontrol
;created =20201206
#warn
#NoEnv
SendMode, Input
SetWorkingDir, %A_ScriptDir%
Gui,2: -dpiscale
GUI,2:+AlwaysOnTop
Gui,2: Color,Black, Black
Gui,2: Font,s14 CGray,Lucida Console
Gui,2:Add, ListBox, x5 y10 w1180 h300 cYellow gRun1 vLB1a
Gui,2:add,button , x10 y330 w250 h35 gA1,URL-LINKS
Gui,2:add,button , x280 y330 w300 h35 gA2,Desktop-LINKS
GUI,2:show, NA W1200 H400 X20 Y10,Test
gosub,a1
return
;----------------------------------------------------------
2GuiClose:
ExitApp
;-----------------
Run1:
Gui,2: Submit, Nohide
try
run,%lb1a%
return
;-------------------------
a1:
e2:="
(Ltrim join|
http://www.xinhuanet.com/english/2020-11/14/c_139516497.htm
http://www.xinhuanet.com/
https://www.theguardian.com/
https://www.dr.dk/radio/
https://news.google.com/news/headlines?hl=nl
http://thesciencepost.com/
"
)
GuiControl,2:,LB1a,|
GuiControl,2:,LB1a,%e2%
return
;-------------------------
a2:
GuiControl,2:,LB1a,|
fd1=%a_desktop%
e:=""
Loop, Files, %fd1%\*.*,D ;- desktop folders
e .= A_LoopFileFullPath . "|"
;Loop, Files, %fd1%\*.lnk , R ;- desktop *.lnk ( links )
; e .= A_LoopFileFullPath . "|"
GuiControl,2:,LB1a,%e%
return
;===============================================================
[/code]