Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  100 Posts | 0 Stories | 300 Comments | 232 Trackbacks

News

Archives

Post Categories

Blogroll

August 2007 Entries

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati