Ich versuche den Inhalt von einer Listbox komplett zu löschen bevor ich die Listbox erneut einlese.
Kann mir bitte jemand sagen ob es noch eine andere Möglichkeit gibt, wie mit der Funktion ==>_GUICtrlListBox_DeleteString jede einzelne Zeile in einer For Next Schleife zu löschen. Es dauert relativ lange wenn man ein grosse Anzahl von Adressen hat.
[autoit]#include <GuiListBox.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Dim $array_1
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 543, 350, 50)
$lbl_top = GUICtrlCreateLabel("",-1,-1,625,100)
GUICtrlSetBkColor(-1,0x000084)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\autoit_240x100.jpg", 200, -1, 240, 100, BitOR($SS_NOTIFY,$WS_GROUP))
$grp_group1 = GUICtrlCreateGroup("Adresse:",5,110,500,50)
$input_input1 = GUICtrlCreateInput("",10,130,490,20)
$grp_group2 = GUICtrlCreateGroup("Liste der Adressen",5,160,500,200)
$list_list1 = GUICtrlCreateList("",10,180,490,175)
$grp_group3 = GUICtrlCreateGroup("Log Information",5,365,500,150)
$edit_edit1 = GUICtrlCreateEdit("Log Infos Zeile 1",10,380,490,130)
$button_listadressen = GUICtrlCreateButton("Adressen anzeigen",520,120,100,30)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button_listadressen
For $i = 1 to UBound($array_1) -1
_GUICtrlListBox_DeleteString($list_list1,0)
Next
_FileReadToArray(@ScriptDir & "\Adressen.txt",$array_1)
For $i = 1 To UBound ($array_1) - 1
_GUICtrlListBox_AddString ($list_list1, $array_1 [$i])
Next
EndSwitch
WEnd