|
怎样叫列表框里不自动排列,不按字母排列..
知道的老大帮帮小第啊谢谢了
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Dim $dir = "QQ.ini"
$Form1 = GUICreate("Form1", 301, 301, 192, 124)
$List1 = GUICtrlCreateList("", 65, 50, 180, 97)
$Input1 = GUICtrlCreateInput("", 108, 160, 120, 21, BitOR($ES_AUTOHSCROLL, $WS_BORDER))
$Input2 = GUICtrlCreateInput("", 108, 200, 120, 21, BitOR($ES_LOWERCASE, $ES_PASSWORD, $WS_BORDER))
$Label1 = GUICtrlCreateLabel("账号:", 50, 160, 52, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("密码:", 50, 200, 52, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("添加", 20, 250, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("删除", 115, 250, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("退出", 210, 250, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
refresh()
;~ GUICtrlSetData($List1, $xs) ;修改指定控件上的文本
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1 ;保存
save()
Case $Button2 ;删除
del()
Case $Button3 ;退出
Exit
EndSwitch
WEnd
Func refresh()
GUICtrlSetData($List1,"") ;修改指定控件的数据
$var = IniReadSectionNames($dir) ;从某标准配置文件(*.ini)中读取所有字段的信息.
If @error Then
MsgBox(4096, "", "发生错误,可能目标文件并非标准的INI文件.")
Else
For $i = 1 To $var[0]
GUICtrlSetData($List1, IniRead($dir, $var[$i], "zh", "Not Found"))
;修改指定控件的数据.从某标准配置文件(*.ini)中读取某个数值.
Next
EndIf
EndFunc ;==>refresh
Func save()
$i = 0
While 1
$i += 1
IniReadSection($dir, "QQ" & $i) ;从某标准配置文件(*.ini)中读取某个节中的所有关键字或值.
If @error Then ExitLoop
WEnd
IniWrite($dir, "QQ" & $i, "zh", GUICtrlRead($Input1)) ;将读取到的值写入ini文件
IniWrite($dir, "QQ" & $i, "mm", GUICtrlRead($Input2)) ;将读取到的值写入ini文件
;MsgBox(0,0,"保存成功")
refresh()
EndFunc ;==>save
Func del()
$var = IniReadSectionNames($dir)
If @error Then
MsgBox(4096, "", "发生错误,可能目标文件并非标准的INI文件.")
Else
For $i = 1 To $var[0]
If IniRead($dir, $var[$i], "zh", "Not Found") = GUICtrlRead($List1) Then
IniDelete($dir, $var[$i])
;MsgBox(0, 0, "删除成功")
refresh()
EndIf
Next
EndIf
EndFunc ;==>del |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|