回复 27# netegg
#include <Date.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <ListviewConstants.au3>
#Include <GuiListView.au3>
#Include <GuiImageList.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
#Include <GuiButton.au3>
#include <GuiComboBox.au3>
$softname="XXX"
$WinMain = GUICreate($softname, 800, 582) ;创建主窗口
$List3 = GUICtrlCreateListView("xxx|aaa|ccc",30,20,400,200)
GUICtrlCreateListViewItem("11-33|fd|sd",$list3)
GUICtrlCreateListViewItem("11-13|fd|sd",$list3)
GUICtrlCreateListViewItem("11-23|fd|sd",$list3)
GUICtrlCreateListViewItem("11-32|fd|sd",$list3)
GUICtrlCreateListViewItem("12-33|fd|sd",$list3)
GUICtrlCreateListViewItem("12-55|fd|sd",$list3)
GUICtrlCreateListViewItem("12-43|fd|sd",$list3)
GUICtrlCreateListViewItem("12-38|fd|sd",$list3)
GUICtrlCreateListViewItem("12-25|fd|sd",$list3)
GUICtrlCreateListViewItem("13-76|fd|sd",$list3)
GUICtrlCreateListViewItem("12-65|fd|sd",$list3)
GUICtrlCreateListViewItem("12-11|fd|sd",$list3)
GUICtrlCreateListViewItem("12-62|fd|sd",$list3)
GUICtrlCreateListViewItem("12-75|fd|sd",$list3)
;以上数据为读取数据库所得
$btn24=GUICtrlCreateButton('读取数据',245,335,80,21)
$combo23=GUICtrlCreateCombo("前缀",131,335,50,14)
$combo24=GUICtrlCreateCombo("后缀",181,335,50,14)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_SQLite_Shutdown ( )
;DirRemove($Temp, 1)
Exit
Case $btn24
For $six =0 To _GUICtrlListView_GetItemCount($List3)-1;获取有数据的行数
$cci=StringSplit(_GUICtrlListView_GetItemText($list3, $six),"-");提取每行首列数据并分拆字符
GUICtrlSetData($combo23,$cci[1],"前缀");将获取到的数据写入combo23
Next
Case $combo23
$iI = _GUICtrlListView_FindinText($list3, GUICtrlRead($combo23));搜索combo23所在行
$mpbz=StringSplit (_GUICtrlListView_GetItemText($list3,$iI),"-");提取指定行首列数据并分拆字符
ControlCommand ($softname,"",$combo24,"DelString",0)
GUICtrlSetData($combo24,$mpbz[2],"后缀");输出获取到的数据到combo24
EndSwitch
WEnd
蛋哥帮忙斧正一下吧,那个实在看不懂... |