Geeks With Blogs
Nat Luengnaruemitchai Geek Blog August 2007 Entries
WPF ComboBox with LimitToList feature: Part I
Sometimes, you would like to get a combobox where a user can type. This can be done by turning on IsEditable property to true. However, it opens another can of worm, it means the user can type anything in the combobox even text that is not in the ItemsSource. To provide LimitToList feature, you can hook up an event to PreviewLostKeyboardFocus as follows: private void ComboBox_PreviewLostKeyboar... sender, KeyboardFocusChangedEventArgs e) { if (!e.Handled) { TextBox textBox = e.OldFocus ......

Posted On Tuesday, August 7, 2007 8:37 PM

Copyright © Nat Luengnaruemitchai | Powered by: