I have a GUI with a drop-down menu (GUICtrlCreateCombo). I'm trying to limit what a user can select in that drop-down. Currently, the user sees the drop-down and can choose one of the options OR they can input anything else in that box. I want to limit what can be chosen in that box to what is listed in the drop-down (shown below as "Dept 1" through "Dept 8"). This is very similar to Excel's data validation if that helps.
$DeptNameLabel = GUICtrlCreateLabel("Department Name", 64, 128, 90, 17)
IF $DeptNameCurrent = "" Then
$DeptName = GUICtrlCreateCombo("Choose from dropdown menu", 160, 128, 217, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
Else
$DeptName = GUICtrlCreateCombo($DeptNameCurrent, 160, 128, 217, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
EndIf
GUICtrlSetData(-1, "Dept 1|Dept 2|Dept 3|Dept 4|Dept 5|Dept 6|Dept 7|Dept 8")
GUICtrlSetTip(-1, "Choose from dropdown")
GUISetState(@SW_SHOW)
Any help would be appreciated! Thanks.