|
本帖最后由 1007236046 于 2012-3-31 09:02 编辑
#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>
$window = GuiCreate("请登录", 500, 310)
GUISetState()
GUISetFont(14)
GUICtrlCreateLabel("用户名:", 50, 40, 80,20)
$userstring = IniRead( "config.ini", "users", "userstring", "")
$userbox = GUICtrlCreateCombo("", 140, 37, 180, 20)
GUICtrlSetData($userbox, $userstring)
_GUICtrlComboBox_LimitText($userbox, 12)
$quit = GUICtrlCreateButton("退 出", 330, 200, 80, 30)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE Or $msg = $quit
Exit
EndSelect
WEnd
假设我的config.ini中userstring=|user1|user2|user3|12345678901234|
我用_GUICtrlComboBox_LimitText($userbox, 12)限制了字符数量,但是config.ini中可以改到超过12个字符(12345678901234) |
|