找回密码
 加入
搜索
查看: 1744|回复: 0

[GUI管理] ListView问题

  [复制链接]
发表于 2013-4-30 15:59:39 | 显示全部楼层 |阅读模式
#include <GUIConstantsEx.au3>
 #include <ListViewConstants.au3>
 #include <WindowsConstants.au3>

 Opt('MustDeclareVars', 1)

 Global $gu_Form1 = GUICreate('Demo', 481, 271, -1, -1)
 Global $gu_ListView1 = GUICtrlCreateListView('第一列|第二列|第三列', 16, 24, 441, 209)

 Global $gua_ListViewItems[4]

 _Main()
 Exit

 Func _Main()
         
         $gua_ListViewItems[1] = GUICtrlCreateListViewItem('第一行|我是第一行|测试数据', $gu_ListView1)
         $gua_ListViewItems[2] = GUICtrlCreateListViewItem('第二行|我是第二行|测试数据', $gu_ListView1)
         $gua_ListViewItems[3] = GUICtrlCreateListViewItem('第三行|我是第三行|测试数据', $gu_ListView1)
         
         GUISetState(@SW_SHOW)
         
         Local $nMsg
         While 1
                 $nMsg = GUIGetMsg()
                 Switch $nMsg
                         Case $GUI_EVENT_CLOSE
                                 Exit
                         Case $gua_ListViewItems[1]
                                 MsgBox(0 + 64, 'Demo', '你单击了第一行', 0, $gu_Form1)
                         Case $gua_ListViewItems[2]
                                 MsgBox(0 + 64, 'Demo', '你单击了第二行', 0, $gu_Form1)
                         Case $gua_ListViewItems[3]
                                 MsgBox(0 + 64, 'Demo', '你单击了第三行', 0, $gu_Form1)
                 EndSwitch
         WEnd
 EndFunc   ;==>_Main
Global $gua_ListViewItems[4] 中的4不固定,有时候肯能是30+还有
Case $gua_ListViewItems[1]这个循环判断句,难道 $gua_ListViewItems[4]中的4 如果是99999我要写9999次判断句吗
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-2 22:36 , Processed in 0.077871 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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