qdrow

Untitled

Sep 23rd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. /// <summary>
  2. /// Логика взаимодействия для MainWindow.xaml
  3. /// </summary>
  4. public partial class MainWindow : Window
  5. {
  6. public MainWindow()
  7. {
  8. InitializeComponent();
  9. }
  10.  
  11. private void Comma_Click (object sender, RoutedEventArgs e)
  12. {
  13. if (!Tablo.Text.Contains(","))
  14. {
  15. Tablo.Text += ",";
  16. }
  17. }
  18. private void Cancel_mode(object sender, RoutedEventArgs e)
  19. {
  20. Button cancel = (Button)sender;
  21. switch (cancel.Content)
  22. {
  23. case "CE":
  24. Tablo.Text = "0";
  25. break;
  26. case "C":
  27. Tablo.Text = "0";
  28. Func_calc.Text = "";
  29. break;
  30. default:
  31. if (Tablo.Text.Length != 1)
  32. {
  33. Tablo.Text = Tablo.Text.Substring(0, Tablo.Text.Length - 1);
  34. }
  35. else
  36. {
  37. Tablo.Text = "0";
  38. }
  39. break;
  40. }
  41. }
  42. private void Numbers(object sender, RoutedEventArgs e)
  43. {
  44. Button Any_but = (Button)sender;
  45. switch (Any_but.Content)
  46. {
  47. case "0":
  48. if (Tablo.Text != "0")
  49. {
  50. Tablo.Text += "0";
  51. }
  52. break;
  53. default:
  54. if (Tablo.Text == "0")
  55. {
  56. Tablo.Text = Convert.ToString(Any_but.Content);
  57. }
  58. else
  59. {
  60. Tablo.Text += Any_but.Content;
  61. }
  62. break;
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment