Funktionreferenz


_GUICtrlComboBoxEx_InitStorage

Beschreibung anzeigen in

Weist den ListBox Items Speicher zu

#include <GuiComboBoxEx.au3>
_GUICtrlComboBoxEx_InitStorage ( $hWnd, $iNum, $iBytes )

Parameter

$hWnd Handle des Controls
$iNum Anzahl von hinzuzufügenden Items
$iBytes Die Menge von Speicher, welche für die Itemstring zugewiesen werden soll in Bytes

Rückgabewert

Erfolg: Die gesamte Anzahl von Items für die Speicher zugewiesen wurde
Fehler: $CB_ERRSPACE

Bemerkungen

Hilft die Initialisierung von großen ComboBoxen (über 100) zu beschleunigen.

Es können Schätzungen für die Parameter $iNum und $iBytes verwendet werden.
Falls man sich überschätzt, wird der zusätzliche Speicher trotzdem zugewiesen.
Falls man sich unterschätzt, wird die normale Zuweisung für Items verwendet, welche die angeforderte Menge überschreiten.

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

_GUICtrlComboBoxEx_AddDir, _GUICtrlComboBoxEx_AddString, _GUICtrlComboBoxEx_InsertString

Beispiel

#include <GuiComboBoxEx.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $hGui, $hCombo

    ; Erstellt eine GUI
    $hGui = GUICreate("ComboBoxEx: Weist den ListBox-Items Speicher zu", 450, 300)
    $hCombo = _GUICtrlComboBoxEx_Create($hGui, "", 2, 2, 446, 296, $CBS_SIMPLE)
    GUISetState(@SW_SHOW)

    MsgBox(8256, "Information", "Es wurde Speicher für: " & _GUICtrlComboBoxEx_InitStorage($hCombo, 150, 300) & " Items bereitgestellt!")
    _GUICtrlComboBoxEx_BeginUpdate($hCombo)

    For $x = 0 To 149
        _GUICtrlComboBoxEx_AddString($hCombo, StringFormat("%03d : Zufallstring", Random(1, 100, 1)))
    Next
    _GUICtrlComboBoxEx_EndUpdate($hCombo)

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example