Sign in to follow this  
Followers 0
zhaicheng

How to triger a event when a column of a listview changes?

4 posts in this topic

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!

Share this post


Link to post
Share on other sites



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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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. :idiot:

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. :idiot:

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0