zhaicheng Posted January 25, 2011 Posted January 25, 2011 How to trigger a event when a column of a listview changes? My purpose is that when certain data in the column changes, a defined function can be executed. Is it possible? Thanks a lot!
Moderators Melba23 Posted January 25, 2011 Moderators Posted January 25, 2011 zhaicheng, A little more information needed. Where is the listview? Can you read the values within it? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
zhaicheng Posted January 26, 2011 Author Posted January 26, 2011 The listview is created using the gui.The code is as follows: Local $hGUI, $iTimerProgress, $iWait = 10, $btn_state Local $aParts[3] = [75, 330, -1] Local $btn_del,$Dxedit,$btn_add,$btn_beg ;_ArrayDisplay($listdateArr) $hGUI = GUICreate("DXZX辅助工具", 800, 600) ;GUICreate("ListView Get Selected Indices", 400, 300) $btn_del = GUICtrlCreateButton("删除", 360, 250, 100, 50) $btn_add = GUICtrlCreateButton("添加", 360, 300, 100, 50) $btn_beg= GUICtrlCreateButton("开始", 360, 350, 100, 50) $hListView = GUICtrlCreateListView("", 2, 2, 600, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) $btn_state = GUICtrlCreateButton("Start Progress Bar", 70, 270, 100, 25) $hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aParts) _GUICtrlStatusBar_SetText($hStatusBar, "Timers") _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) GUICtrlSetColor($progress, 0xff0000) _GUICtrlStatusBar_EmbedControl($hStatusBar, 1, GUICtrlGetHandle($progress)) _Timer_SetTimer($hGUI, 1000, "_UpdateStatusBarClock") ; create timer $Dxedit = GUICtrlCreateEdit("First line" & @CRLF, 10, 300, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL+$ES_MULTILINE + $ES_WANTRETURN) GUISetState() ; Add columns _GUICtrlListView_AddColumn($hListView, "ZX地址", 100) _GUICtrlListView_AddColumn($hListView, "JPG地址", 100) _GUICtrlListView_AddColumn($hListView, "书名", 100) _GUICtrlListView_AddColumn($hListView, "From Page", 100) _GUICtrlListView_AddColumn($hListView, "To Page", 100) _GUICtrlListView_AddColumn($hListView, "状态", 100) ; Add items
Moderators Melba23 Posted January 26, 2011 Moderators Posted January 26, 2011 (edited) zhaicheng, As you are filling the ListView, how is it that you do not know when the details change and you need to run your function? Please explain how you are filling the ListView and why you cannot use the filling code as a trigger. M23 P.S. If you want help, posting code that needs many essential lines added to get it to run is not the way to go about it. Edit: I have just seen your other post - if you get that to work I suggest you will have the answer to this problem as well. Edited January 26, 2011 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now