找回密码
 加入
搜索
查看: 2117|回复: 1

[GUI管理] [已解决]怎么做出来的gui界面当我鼠标移过去,老显示第一个题目啊

[复制链接]
发表于 2013-3-13 12:38:18 | 显示全部楼层 |阅读模式
本帖最后由 weeew 于 2013-3-19 12:06 编辑

问题是:运行的时候能正常初始化第一个题目,按下一题也能切换到下一题,但是当我鼠标移到radio控件时,会变成初始的第一个题目内容。
#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
 楼主| 发表于 2013-3-14 09:30:42 | 显示全部楼层
找到问题了
GUICtrlSetData 来设置控件
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-23 02:47 , Processed in 0.089080 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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