Jump to content

Edit ListView items at runtime?


Recommended Posts

Say, Ive got a ListView.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 418, 210, 193, 115)
$ListView1 = GUICtrlCreateListView("Test|Test|Test", 0, 0, 417, 209, BitOR($LVS_REPORT,$LVS_EDITLABELS,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS))
GUICtrlSendMsg($listview1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
GUICtrlSendMsg($listview1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
$ListView1_0 = GUICtrlCreateListViewItem("Test1|Test2|Test3", $ListView1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $ListView1_0
            MsgBox(0, "", GUICtrlRead($ListView1_0))
    EndSwitch
WEnd

Just say, I wanted to:

When I click, for example, Test3.

Then, I want it to be editable.

So, In short.

I click the text, And I can edit it.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

How about:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $ListView1_0
            $InputData = InputBox("AForm1", "Enter new data")
            If Not @error Then GUICtrlSetData($ListView1_0, $InputData)
    EndSwitch
WEnd

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Not using an inputbox, I mean, When you double click the section, It turns into a section, where you can type.

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Hi,

sorry it's not working on most recent versions of AutoIt, I think; try the "exe" compiled on my machine, or try newer version?

Best, Randall

** Woops, sorry; it must have been an old file.

Try

Edited by randallc
Link to comment
Share on other sites

Hi

PS - seeing my script won't work in new AutoIt version, I have hunted down the original author and script; - eltorro

Edit In Place Listview (multi-column), Combination of old script, new code allows one to edit listview data.Best, Randall

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...