#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#NoTrayIcon
#include <Inet.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <Array.au3>
#include<date.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 775, 516, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
;$ListView1 = GUICtrlCreateListView("", 0, 8, 761, 497,$LVS_SHOWSELALWAYS,$LVS_EX_GRIDLINES)
$ListView1 = GUICtrlCreateListView("", 0, 8, 761, 497, $LVS_SHOWSELALWAYS + $LVS_OWNERDATA, $LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT + $LVS_EX_DOUBLEBUFFER)
_GUICtrlListView_BeginUpdate($ListView1)
_GUICtrlListView_AddColumn($ListView1, '日期时间', 100)
_GUICtrlListView_AddColumn($ListView1, '产品名称', 300)
_GUICtrlListView_AddColumn($ListView1, '价格', 80)
GUICtrlSetFont(-1, 12, 4000, 0, "MS Sans Serif")
GUICtrlSetOnEvent(-1, "ListView1Click")
GUISetState(@SW_SHOW)
$SQLite_Data_Path = "jd.db"
Local $aRow
Local $aResult, $iRows, $iColumns, $hQuery, $ONd, $vv, $i
_SQLite_Startup() ;加载 SQLite.dll
If @error Then
MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded!")
Exit -1
EndIf
_SQLite_Open($SQLite_Data_Path)
;_SQLite_Query(-1, "SELECT * FROM jd;", $hQuery)
;_SQLite_FetchData($hQuery, $aRow)
;_SQLite_FetchData($hQuery, $aRow)
_SQLite_GetTable2d(-1, "SELECT * FROM jd;", $aResult, $aRow, $iColumns)
;MsgBox(1,$aRow,$iColumns)
MsgBox(1, $aResult[4][1], $aRow)
Local $i = 1
While $i <= $aRow
_GUICtrlListView_AddItem($ListView1, $aResult[$i][0])
_GUICtrlListView_AddSubItem($ListView1, 0, $aResult[$i][1], 1, 1)
_GUICtrlListView_AddSubItem($ListView1, 0, $aResult[$i][2], 2, 2)
$i = $i + 1
WEnd
_GUICtrlListView_EndUpdate($ListView1)
#CS For $i =1 To $aRow
;MsgBox(1, $aRow[1], $aRow[$i])
_GUICtrlListView_AddItem($ListView1,$aResult[$i][0])
_GUICtrlListView_AddSubItem($ListView1, 0, $aResult[$i][1], 1, 1)
_GUICtrlListView_AddSubItem($ListView1, 0, $aResult[$i][2], 2,2)
Next
#CE
_SQLite_Close()
_SQLite_Shutdown()
While 1
Sleep(100)
WEnd
Func Form1Close()
Exit
EndFunc ;==>Form1Close
Func Form1Maximize()
EndFunc ;==>Form1Maximize
Func Form1Minimize()
EndFunc ;==>Form1Minimize
Func Form1Restore()
EndFunc ;==>Form1Restore
Func ListView1Click()
EndFunc ;==>ListView1Click
|