找回密码
 加入
搜索
楼主: sliqi

[GUI管理] ListViewItem数据修改问题【已解决】

 火.. [复制链接]
发表于 2011-8-4 10:49:32 | 显示全部楼层
回复 15# sliqi
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <array.au3>

Dim $listview, $button, $item[100][3], $input1, $msg, $from, $list
$from = GUICreate("listview", 220, 250)

$listview = GUICtrlCreateListView("列 1 |列 2|列 3  ", 10, 10, 200, 150)
_GUICtrlListView_AddColumn($ListView, "列1")
_GUICtrlListView_AddColumn($ListView, "列2")
_GUICtrlListView_AddColumn($ListView, "列3")

For $i=0 to UBound($item)-1
;~         For $n=0 to UBound($item,2)-1
                $item[$i][0]="项"&$i
                $item[$i][1]="子项"&$i
                $item[$i][2]=Random(1,10,1)
;~         Next
Next

_GUICtrlListView_AddArray($ListView,$item)
$button = GUICtrlCreateButton("10修改成abc", 40, 170, 120, 20)
GUISetState()


Do
        $msg = GUIGetMsg()

        Select
                Case $msg = $button
                        $Search= _ArrayFindAll($item,10,0,0,0,0,2)
                        _GUICtrlListView_BeginUpdate($listview)
                        For $i=0 to UBound($Search)-1
                                _GUICtrlListView_SetItem($listview,"abc",$Search[$i],2)
                                $item[$Search[$i]][2]="abc"
                        Next
                        _GUICtrlListView_EndUpdate($listview)
        EndSelect
Until $msg = $GUI_EVENT_CLOSE
 楼主| 发表于 2011-8-4 11:31:21 | 显示全部楼层
莫拜,很好很强大,谢谢3mile 兄
发表于 2011-8-4 13:09:03 | 显示全部楼层
学习学习!!!!!!!!!!
 楼主| 发表于 2011-8-7 00:54:39 | 显示全部楼层
回复 4# powerofos

powerrofos兄,请教你一个问题
如果listiviewitem 有3行一样的数据请问怎么获取显示 3 呢?
发表于 2011-8-7 02:16:20 | 显示全部楼层
本帖最后由 powerofos 于 2011-8-7 02:22 编辑

回复 19# sliqi


这帖子进行到这阶段,3mile也贴出了代码,而且你发问的问题,也随着问题的解决而逐步不同,我回头看了下着帖子,却不懂你的意思?

3mile说的从:数据源上查找并修改列表数据,这个方法,你采用了没?
抑或是按照原来的思路?这个将影响到你这次发问的这个答案呀!!

说的清楚些能让帮忙的人更轻松愉快啊。

小提示一下:这个帖子已结...可能的话开个新贴?
发表于 2011-8-7 23:45:43 | 显示全部楼层
不是把怎么越该越乱
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-1 21:35 , Processed in 0.076116 second(s), 13 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表