-1

我做了这个功能:

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")
4

1 回答 1

0
GUICtrlSetData($Combo1, IniRead("C:\Config.ini", "Combo", "Comb1", -Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M"))

像这样的东西?
补习班

于 2013-07-26T11:38:20.723 回答