Gets the length, in characters, of a string in the list of a combo box
#include <GuiComboBox.au3>
_GUICtrlComboBox_GetLBTextLen ( $hWnd, $iIndex )
$hWnd | Control ID/Handle to the control |
$iIndex | index of the required entry |
Success: | the length of the string. |
Failure: | -1. |
#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $idCombo
; Create GUI
GUICreate("ComboBox Get LB Text Len", 400, 296)
$idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296)
GUISetState(@SW_SHOW)
; Add files
_GUICtrlComboBox_BeginUpdate($idCombo)
_GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
_GUICtrlComboBox_EndUpdate($idCombo)
; Get LB Text Len
MsgBox($MB_SYSTEMMODAL, "Information", "LB Text Len: " & _GUICtrlComboBox_GetLBTextLen($idCombo, 2))
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example