placebo Posted October 8, 2008 Share Posted October 8, 2008 CODE$var = DriveGetDrive( "all" ) If NOT @error Then MsgBox(4096,"", "Found " & $var[0] & " drives") For $i = 1 to $var[0] MsgBox(4096,"Drive " & $i, $var[$i]) Next EndIf ; LIST GuiCtrlCreateList("", 5, 190, 100, 90) GuiCtrlSetData(-1, "item", "item") this is my code, i want to view all my drives in a listbox. I have all my drives in an array, and i want that array to be the source-data for my list-control. how do i have to work? Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 8, 2008 Share Posted October 8, 2008 $var = DriveGetDrive( "all" ) If NOT @error Then MsgBox(4096,"", "Found " & $var[0] & " drives") For $i = 1 to $var[0] MsgBox(4096,"Drive " & $i, $var[$i]) Next EndIf ; LIST GuiCtrlCreateList("", 5, 190, 100, 90) GuiCtrlSetData(-1, "item", "item") this is my code, i want to view all my drives in a listbox. I have all my drives in an array, and i want that array to be the source-data for my list-control. how do i have to work? Just put GuiCtrlSetData() in a loop, the same way you did the "Drive" MsgBox(). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
martin Posted October 8, 2008 Share Posted October 8, 2008 (edited) CODE$var = DriveGetDrive( "all" ) If NOT @error Then MsgBox(4096,"", "Found " & $var[0] & " drives") For $i = 1 to $var[0] MsgBox(4096,"Drive " & $i, $var[$i]) Next EndIf ; LIST GuiCtrlCreateList("", 5, 190, 100, 90) GuiCtrlSetData(-1, "item", "item") this is my code, i want to view all my drives in a listbox. I have all my drives in an array, and i want that array to be the source-data for my list-control. how do i have to work?Have a look at th eexample in the help for a list view. EDIT: as PsaltyDS says or like this. $gui = GUICreate("list Drives", 200, 300, 200, 200) ; LIST $lv = GUICtrlCreateList("", 5, 190, 100, 90) GUISetState() $listData = "" $var = DriveGetDrive("all") If Not @error Then MsgBox(4096, "", "Found " & $var[0] & " drives") For $i = 1 To $var[0] MsgBox(4096, "Drive " & $i, $var[$i]) $listData &= $var[$i] & '|' Next EndIf GUICtrlSetData($lv, $listData) While GUIGetMsg() <> -3 WEnd Edited October 8, 2008 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
placebo Posted October 8, 2008 Author Share Posted October 8, 2008 thanks :-) it works fine! stupid question of me! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now