독개

[오토핫키] 리스트박스

by #독개#
global listMessage ;반드시 글로벌로 지정해줘야한다


Gui Add, ListBox, x30 y150 w260 h290 vnotice_list, 진행사항을 나타내줍니다.
Gui,Show

F1::
List_Message("출력")
return

List_Message(x)
{
	gui, submit, nohide
	formattime , nowtime,,HH:mm:ss
	message := x
	listMessage = %nowtime% %message%|%listMessage%
	guicontrol,,notice_list, |%listMessage%
	return
}

 

 

자동으로 스크롤다운

#SingleInstance force

Gui, add, edit,     x6 y6  w400 r5 hwndhEdit vedit,
Gui, add, listview, x6 y+5 wp   r5 hwndhlv   vlv, aaa|bbb|ccc
Gui, add, listbox,  x6 y+5 wp   r5 hwndhlb   vlb,
gui, add, button, x6 y+10 gAAS1, Add 1 and Scroll down 1
gui, add, button, x6 y+1  gAAS2, Add 1 and Scroll to bottom
gui, show
return


AAS1:
AAS2:
	Gui, Submit, NoHide
	counter+=1
	GuiControl,, edit, % trim(edit "`nNewline " counter, "`r`n")
	LV_Add("", "Newline " counter)
	LV_ModifyCol(),LV_ModifyCol(2, "autohdr"),LV_ModifyCol(3, "autohdr")
	GuiControl,, lb, Newline %counter%
	
	if (A_ThisLabel="AAS1") ; Scroll down 1
	{		
		sendmessage, 0x115, 1, 0,, ahk_id %hEdit%
		sendmessage, 0x115, 1, 0,, ahk_id %hlv%
		sendmessage, 0x115, 1, 0,, ahk_id %hlb%
	}
	else if (A_ThisLabel="AAS2") ; Scroll to bottom
	{
		sendmessage, 0x115, 7, 0,, ahk_id %hEdit%
		sendmessage, 0x115, 7, 0,, ahk_id %hlv%
		; alternatively for listview:
		; LV_Modify(LV_GetCount(), "Vis")
		sendmessage, 0x115, 7, 0,, ahk_id %hlb%
	}
return


GuiClose:
esc::
	ExitApp
return

 

블로그의 정보

독한 개발자

#독개#

활동하기