FocusControl.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Input;
  6. using Muchinfo.WPF.Controls;
  7. //----------------------------------------------------------------
  8. //Module Name: $safeprojectname$
  9. //Purpose:
  10. //CopyRight: Muchinfo
  11. //History:
  12. //----------------------------------------------------------------
  13. //DateTime 2017/3/1 16:44:12
  14. //Author
  15. //Description Create
  16. //----------------------------------------------------------------
  17. using System.Windows.Controls;
  18. namespace Muchinfo.MTPClient.Account.Utilities
  19. {
  20. public class FocusComboBox : ComboBox
  21. {
  22. protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e)
  23. {
  24. ///处理不改变选择
  25. }
  26. }
  27. public class FocusDecimalNumBox : DecimalNumBox
  28. {
  29. protected override void OnPreviewKeyDown(KeyEventArgs e)
  30. {
  31. base.OnPreviewKeyDown(e);
  32. if (e.Key == Key.Up || e.Key == Key.Down)
  33. {
  34. e.Handled = true;
  35. }
  36. }
  37. }
  38. }