找回密码
 加入
搜索
查看: 2013|回复: 1

[AU3基础] 关于View自动选择的问题

[复制链接]
发表于 2010-5-21 22:29:18 | 显示全部楼层 |阅读模式
如代码所示,当$ListView1添加到$ListView2之后,必需再点击$ListView1才可以添加
问题就是:怎么才能$ListView1添加到$ListView2之后,默认选择到$ListView1的第一项,然后再点添加又可以添加到$ListView2.
说明下.GUICtrlCreateListViewItem("01|加速|ED031R",$ListView1) 这些只是表达用的,具体程序是读取ini文件.
不知道我表达的够详细么.期待高手解答.
努力--认真---学习---探索----
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 534, 297, 192, 114)
$ListView1 = GUICtrlCreateListView("编号|功能|状态", 24, 16, 185, 241)
$Button1 = GUICtrlCreateButton("添加→", 224, 80, 73, 25)
$ListView2 = GUICtrlCreateListView("编号|功能|状态", 309, 16, 185, 241)
GUICtrlCreateListViewItem("01|加速|ED031R",$ListView1)
GUICtrlCreateListViewItem("02|加倍|ED032R",$ListView1)
GUICtrlCreateListViewItem("03|负重|ED033R",$ListView1)
GUICtrlCreateListViewItem("04|攻速|ED034R",$ListView1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1 
        $q = _GUICtrlListView_GetSelectedIndices($ListView1, True)
        If UBound($q) > 1 Then
                GUICtrlCreateListViewItem(GUICtrlRead(GUICtrlRead($ListView1)),$ListView2)
                _GUICtrlListView_DeleteItemsSelected(GUICtrlGetHandle($ListView1))
                EndIf
EndSwitch
WEnd
发表于 2010-5-21 23:11:21 | 显示全部楼层
_GUICtrlListView_SetItemSelected($ListView1,0)
在你的ENDIF之前加上这句。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 05:38 , Processed in 0.075707 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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