终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

82 行
2.2 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace BPASmartClient.CustomResource.UserControls
  16. {
  17. /// <summary>
  18. /// NumberTextBox.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class NumberTextBox : UserControl
  21. {
  22. public NumberTextBox()
  23. {
  24. InitializeComponent();
  25. }
  26. private void outLoc_GotFocus(object sender, RoutedEventArgs e)
  27. {
  28. this.pp.IsOpen = outLoc.Focusable;
  29. }
  30. private void Button_Click(object sender, RoutedEventArgs e)
  31. {
  32. var obj = (Button)sender;
  33. switch (obj.Content)
  34. {
  35. case "0":
  36. case "1":
  37. case "2":
  38. case "3":
  39. case "4":
  40. case "5":
  41. case "6":
  42. case "7":
  43. case "8":
  44. case "9":
  45. input.Text = input.Text.Trim() + obj.Content.ToString();
  46. break;
  47. case ".":
  48. if (!string.IsNullOrEmpty(input.Text) && input.Text.Length > 0)
  49. input.Text = input.Text.Trim() + obj.Content.ToString();
  50. break;
  51. case "ESC":
  52. this.pp.IsOpen = false;
  53. break;
  54. case "BR":
  55. if (!string.IsNullOrEmpty(input.Text) && input.Text.Length > 0)
  56. input.Text = input.Text.Remove(input.Text.Length - 1);
  57. break;
  58. case "Clear":
  59. input.Text = string.Empty;
  60. break;
  61. case "Deter":
  62. outLoc.Text = input.Text;
  63. this.pp.IsOpen = false;
  64. break;
  65. default:
  66. break;
  67. }
  68. }
  69. private void input_GotFocus(object sender, RoutedEventArgs e)
  70. {
  71. }
  72. }
  73. }