我做了这个功能:
Func ReadStats()
$Read1 = IniRead("C:\Config.ini", "Checkbox", "Check1", "1")
$Read2 = IniRead("C:\Config.ini", "Checkbox", "Check2", "1")
$Read3 = IniRead("C:\Config.ini", "Combo", "Comb1", StringSplit("-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M", "|"))
GUICtrlSetState($chosen, IniRead("C:\Config.ini", "Combo", "Comb1", StringSplit("-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M", "|")))
If $Read1 = Int(1) = 1 Then
GUICtrlSetState($Checkbox1, $GUI_CHECKED)
Else
GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
EndIf
If $Read2 = Int(1) = 1 Then
GUICtrlSetState($Checkbox2, $GUI_CHECKED)
Else
GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
EndIf
EndFunc
1。我如何让它工作
$Read3 = IniRead("C:\Config.ini", "Combo", "Comb1", StringSplit("-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M", "|"))
GUICtrlSetState($chosen, IniRead("C:\Config.ini", "Combo", "Comb1", StringSplit("-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M", "|")))
2。如何才能让它在启动时运行一次?如果你想知道,我使用这段代码来写信息:
Case $GUI_EVENT_CLOSE
IniWrite("C:\Config.ini", "Checkbox", "Check1", GUICtrlRead($Checkbox1))
IniWrite("C:\Config.ini", "Checkbox", "Check2", GUICtrlRead($Checkbox2))
IniWrite("C:\Config.ini", "Combo", "Comb1", $chosen)
Exit
$ Combo1的创建方式如下:
$Combo1 = GUICtrlCreateCombo("-Xmx512M", 24, 872, 161, 25, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M")
答案 0 :(得分:0)
GUICtrlSetData($Combo1, IniRead("C:\Config.ini", "Combo", "Comb1", -Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M"))
这样的事情?
CRAM