#NoTrayIcon
#include <GUIListBox.au3>
#Include <GuiListView.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("TrayIconHide", 1)
Opt('MustDeclareVars', 1)
Opt("GUICloseOnESC", 0)
Global $zhongzi,$ts[31]
Global $Form1, $Title, $SQLite_Data_Path, $GUI_ListBox
Global $Label1, $Label2, $Radio1, $Radio2, $Radio3,$Radio4,$Button1,$Button2,$Button3
Global $GUI_Button1, $GUI_Button2, $GUI_Button3, $GUI_Button4
Global $Msg, $hQuery, $aRow
Global $Temp, $a, $b, $c,$d,$f,$no,$da,$chengji,$zhtai
$Title = "SQLite操作实例..."
$SQLite_Data_Path = "tiki.db"
_SQLite_Startup () ;加载 SQLite.dll
for $d=1 to 30
$ts[$d]=Random(1,474,1)
for $f=1 to $d
if $ts[$d]=$ts[$f] Then
$ts[$d]=Random(1,474,1)
EndIf
Next
Next
$NO=1
_SQLite_Open ($SQLite_Data_Path)
_SQLite_Query(-1, "SELECT * FROM tiku where id='"&$ts[$no]&"';",$hQuery)
if _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK Then
$no=$no+1
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("选择题练习", 625, 442, 192, 124)
$Label1 = GUICtrlCreateLabel($aRow[6], 40, 16, 484, 33)
$Radio1 = GUICtrlCreateRadio($aRow[1], 48, 64, 481, 33)
$Radio2 = GUICtrlCreateRadio($aRow[2], 48, 136, 481, 41)
$Radio3 = GUICtrlCreateRadio($aRow[3], 48, 208, 481, 41)
$Radio4 = GUICtrlCreateRadio($aRow[4], 48, 280, 441, 41)
$Button1 = GUICtrlCreateButton("上一题", 360, 392, 65, 33)
$Button2 = GUICtrlCreateButton("下一题", 432, 392, 65, 33)
$Button3 = GUICtrlCreateButton("查看", 504, 392, 65, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Else
Exit
EndIf
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
SQLiteRead()
$Label2 = GUICtrlCreateLabel($chengji, 44, 384, 100, 17)
EndSwitch
WEnd
func SQLiteRead()
_SQLite_Open ($SQLite_Data_Path)
_SQLite_Query(-1, "SELECT * FROM tiku where id='"&$ts[$no]&"';",$hQuery)
if _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK Then
$Label1 = GUICtrlCreateLabel($aRow[6], 40, 16, 484, 33)
$Radio1 = GUICtrlCreateRadio($aRow[1], 48, 64, 481, 33)
$Radio2 = GUICtrlCreateRadio($aRow[2], 48, 136, 481, 41)
$Radio3 = GUICtrlCreateRadio($aRow[3], 48, 208, 481, 41)
$Radio4 = GUICtrlCreateRadio($aRow[4], 48, 280, 441, 41)
$da=$aRow[0]
EndIf
;_SQLite_Close ()
EndFunc