Jump to content

Is it possible to lock a ComboBox from selecting items, but still retrieve current shown item?


poila
 Share

Recommended Posts

Sample code:

;   Enter username to transfer item to Input
    $newUserInput = GUICtrlCreateCombo("", 180, 170, 350, 35, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL, $CBS_SORT))
    GUICtrlSetFont(-1, 14, 400, 0, "Tahoma")
    GUICtrlSendMsg(-1, $CB_SETMINVISIBLE, 10, 0)

Part 2 of sample code:

If $itemString <> "" Then
        Local $mySQLstatement = "SELECT * FROM Inventory WHERE Name = '" & $itemString & "' AND Status = 1"
        $executeStatement = _Query($global_SQLInstance, $mySQLstatement)
        $internalName = $executeStatement.Fields("Name").value
        $usernameID = $executeStatement.Fields("UserID").value
        GUICtrlSetData($userInput, getName("User", $usernameID))
        GUICtrlSetData($itemInput, "|" & getString("UserItem", $usernameID) & "|", $Name)
        GUICtrlSetData($newUserInput, "|" & getString("Username", $usernameID))
    EndIf

Is it possible to prevent users from changing selection of items in the combobox?

If so, is it possible to retrieve the value or data of the item currently shown in the combobox?

If so/not so, how do I retrieve the value of item displayed?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...