本帖最后由 诺言 于 2011-8-10 16:22 编辑 Dim $Var
$Drive=DriveGetDrive("ALL")
For $i = 1 To $Drive[0]
$Var=$Var&StringUpper($Drive[$i])&"|"
Next
MsgBox(0,0,$Var)
#include <GUIConstantsEx.au3>
$Form1 = GUICreate("", 100, 100, -1, -1)
$Combo1 = GUICtrlCreateCombo("", 10, 10, 40, 20, 0x0003)
;~ GUICtrlSetData(-1,"1|2|3","1")
GUICtrlSetData($Combo1,StringReplace($Var,"|","",-1),StringUpper($Drive[1]))
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
已经自己解决,原因:GUICtrlCreateCombo不能定义高度Dim $Var
$Drive=DriveGetDrive("ALL")
For $i = 1 To $Drive[0]
$Var=$Var&StringUpper($Drive[$i])&"|"
Next
MsgBox(0,0,$Var)
#include <GUIConstantsEx.au3>
$Form1 = GUICreate("", 100, 100, -1, -1)
$Combo1 = GUICtrlCreateCombo("", 10, 10, 40, -1, 0x0003)
;~ GUICtrlSetData(-1,"1|2|3","1")
GUICtrlSetData($Combo1,StringReplace($Var,"|","",-1),StringUpper($Drive[1]))
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|