Tham khảo tài liệu 'giáo trình how to use autoit a professional manner part 55', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | include Opt MustDeclareVars 1 Example Func Example Local date del msg GUICreate My GUI delete control 200 200 800 200 date GUICtrlCreateDate 1953 04 25 10 10 185 20 del GUICtrlCreateButton Delete control 50 50 70 20 GUISetState Run the GUI until the dialog is closed Do msg GUIGetMsg If msg del Then GUICtrlDelete date GUICtrlDelete del EndIf Until msg GUI_EVENT_CLOSE EndFunc Example Function Reference GUICtrlRegisterListViewSort Register a user defined function for an internal listview sorting callback function. GUICtrlRegisterListViewSort controlID function Parameters controlID The listview controlID for which the user function should proceed. function The name of the user function to call when the sorting callback runs. Return Value Success 1 Failure 0 Remarks To make the user function workable you have to define it with maximum 4 function parameters otherwise the function won t be called Func MySortFunction nListViewID LParam1 LParam2 nColumn . EndFunc Or Func MySortFunction nListViewID LParam1 LParam2 . EndFunc When the user function is called then these 4 parameters have the following values Position Parameter Meaning 1 controlID The controlID of the listview control for which the callback function is used. 2 IParaml The lParam value of the first item by default the item controlID . 3 lParam2 The lParam value of the second item by default the item controlID . 4 column The column that was clicked for sorting the first column number is 0 . The following values have to be Returned to change the behaviour of the sorting callback Return value Meaning -1 1st item should precede the 2nd. 0 No Change. 1 1st item should follow the 2nd. See also examples for sorting with selfcreated GUI listview items. Related GUICtrlCreateListV iew Example include include Opt MustDeclareVars 1 Global SnCurCol -1 Global SnSortDir 1 Global bSet 0 Global nCol -1 Example1 Example2 Example 1 - sorting 3 column s different Func