I am typing in an Item that is in the item collection.
In my test, I type HIP, and HIP is in the item collection. HIP shows up
right under where I type HIP.
As I step through the code, on Leave of the combobox named cboPrivilege, the
value of cboPrivilege.SelectedValue = <undefined value>.
Also the DropDownStyle for the combobox is set to Simple.
"Kevin Yu [MSFT]" wrote:
> Hi Cadel,
>
> When the ComboBox loses focus, there is no item selected. We can't use
> cboPrivilege.SelectedItem = cboPrivilege.Text to select the item, because
> SelectedItem has to be an item in the item collection of the ComboBox. Also
> the three chars you have typed doesn't exist in the collection. So, in this
> case, we have to write more logics, to find out which item is the most
> likely to be used, get the index of this item and use
> cboPrivilege.SelectedIndex = index to get the item selected.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>
|