Hi,
I need a ComboBox where
- The user can't select items with the mouse
- The user can't select items with the keyboard
- The MouseEnter and MouseLeave events still fire
I thought setting IsReadOnly to true would make the control readonly, but that doesnt seem to do anything?
So far the only thing that gets close is the code below, but that seems to still allow keyboard selection to slip through about 1 in 3 tries despite the flag.
Is there a "real" way to do this? I mean one that is not so hacked and that works all the time?
The way the control looks is not much of an issue (e.g. IsEnabled = false is fine), but I do need the MouseEnter and MouseLeave events and the user should not be able to change the value in any way.
Regards,
Bayram
if
(isReadOnly)
{
c.MainComboBox.MaxDropDownHeight = 0;
c.MainComboBox.CanKeyboardNavigationSelectItems =
false
;
}
else
{
c.MainComboBox.MaxDropDownHeight = 300;
c.MainComboBox.CanKeyboardNavigationSelectItems =
true
;
}
c.MainComboBox.IsReadOnly = isReadOnly;