#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
#Region ### START GUI section ###
Local $Mac, $treeview, $pctest, $btn1, $btn2
Local $jls = 0
Local $tree[8]
$pctest = GUICreate("示例 ", 200, 300)
GUICtrlSetState(-1, $Gui_Disable)
GUICtrlCreateGroup("选中后保存", 40, 75, 105, 220)
GUICtrlCreateGroup("", 5, 420, 510, 35)
GUICtrlSetBkColor(-1, 0xf5deb3)
GUISetFont(10, 400, 1)
$treeview = GUICtrlCreateTreeView(55, 95, 75, 160, $TVS_CHECKBOXES)
For $i = 0 To UBound($tree)-1
$tree[$i] = GUICtrlCreateTreeViewItem("test" & $i+1, $treeview)
If IniRead("txt.txt", "config", "tree" & $i, 0) = 1 Then
GUICtrlSetState($tree[$i], $GUI_CHECKED)
EndIf
Next
$btn1 = GUICtrlCreateButton("保存", 45, 260, 45, 25, $BS_DEFPUSHBUTTON)
$btn2 = GUICtrlCreateButton("退出", 95, 260, 45, 25)
GUISetState()
#EndRegion ### end GUI section ###
;-------------------------------------------------------------------------------------------------------------------------
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $btn1
If MsgBox(4, "提示", "保存吗?") = 6 Then
For $i = 0 To UBound($tree)-1
If GUICtrlRead($tree[$i]) = 1 or GUICtrlRead($tree[$i])=257 Then
IniWrite("txt.txt", "config", "tree" & $i, 1)
Else
IniWrite("txt.txt", "config", "tree" & $i, 0)
EndIf
Next
EndIf
Case $btn2
ExitLoop
EndSwitch
WEnd
其中的设置字体GUISetFont(10, 400, 1)中的10越大时,test前面的方框就越靠下,不知有无办法让其与后面的TEST在同一水平线上?