|
本帖最后由 小凯 于 2012-7-23 10:42 编辑 #include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=d:\系统文件\桌面\autotem\邮箱\通讯簿sql.kxf
$Form1_1 = GUICreate("Form1", 788, 438, 194, 132, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_ACCEPTFILES,$WS_EX_WINDOWEDGE))
$ListView1 = GUICtrlCreateListView("公司名称|人数", 8, 8, 186, 422)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 120)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
$ListView1_0 = GUICtrlCreateListViewItem("西丽呼叫中心", $ListView1)
$ListView1_1 = GUICtrlCreateListViewItem("", $ListView1)
$ListView2 = GUICtrlCreateListView("姓名|Email|隶属分公司", 208, 64, 562, 222)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 200)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 120)
$Button1 = GUICtrlCreateButton("清除", 688, 32, 75, 25)
$Input1 = GUICtrlCreateInput("Input1", 552, 32, 113, 21)
$Combo1 = GUICtrlCreateCombo("模糊查找", 552, 8, 73, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label1 = GUICtrlCreateLabel("查找模式", 498, 11, 52, 17)
$Label2 = GUICtrlCreateLabel("查找字符", 499, 34, 52, 17)
$Input2 = GUICtrlCreateInput("Input2", 247, 4, 185, 21)
$Label3 = GUICtrlCreateLabel("地址", 216, 8, 28, 17)
$Label4 = GUICtrlCreateLabel("帐号", 216, 37, 28, 17)
$Label5 = GUICtrlCreateLabel("密码", 310, 37, 28, 17)
$Input3 = GUICtrlCreateInput("Input3", 248, 32, 57, 21)
$Input4 = GUICtrlCreateInput("Input3", 341, 32, 89, 21)
$Button2 = GUICtrlCreateButton("连接", 436, 2, 43, 25)
$Button3 = GUICtrlCreateButton("断开", 437, 33, 43, 25)
$Button4 = GUICtrlCreateButton("Button4", 688, 2, 75, 25)
$Button5 = GUICtrlCreateButton("剪切板", 629, 5, 43, 25)
$ListView3 = GUICtrlCreateListView("事件|时间|行为", 208, 293, 562, 134)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 110)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 230)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
For $i = 0 To 20
;~ GUICtrlCreateListViewItem($i&"|"&$i&"|"&$i,$ListView3)
_GUICtrlListView_InsertItem($ListView3,$i,0)
_GUICtrlListView_AddSubItem($ListView3, 0,$i, 1)
_GUICtrlListView_AddSubItem($ListView3, 0, $i, 2)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_GUICtrlListView_DeleteAllItems($ListView3)
EndSwitch
WEnd
For $i = 0 To 20
;~ GUICtrlCreateListViewItem($i&"|"&$i&"|"&$i,$ListView3)
_GUICtrlListView_InsertItem($ListView3,$i,0)
_GUICtrlListView_AddSubItem($ListView3, 0,$i, 1)
_GUICtrlListView_AddSubItem($ListView3, 0, $i, 2)
Next
这里 如果是用GUICtrlCreateListViewItem($i&"|"&$i&"|"&$i,$ListView3) 增加数据的话!!是可以清除掉listview3的数据的!
但是如果用_GUICtrlListView_InsertItem的方法增加数据,_GUICtrlListView_DeleteAllItems却清除不掉...
_GUICtrlListView_InsertItem是插入数据到第一项,因为我想让最新的数据在顶层...
顺道问一下. 有没有类似于C#中if的不等于语法啊? if $Input1.text != "123" Input1不等于123. 因为有时候只想检测这个控件数据值不等于指定值就可以了,所以想问下有没有类似的..
请教各位大神了..
新手上路,努力学习中!!!!
|
|