Sign in to follow this  
Followers 0
AzKay

Edit ListView items at runtime?

11 posts in this topic

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- #

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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- #

Share this post


Link to post
Share on other sites

Nothing happens if I double click the cells. oo, Am I missing something here?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I just tryed the EXE, Nothing happens when I double click a cell. oo


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Nice :3

Thanks.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
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

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