qdrow

Untitled

Oct 17th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. /// <summary>
  2. /// Логика взаимодействия для MainWindow.xaml
  3. /// </summary>
  4. public partial class MainWindow : Window
  5. {
  6. public int[] ValueMass = new int[64];
  7. public MainWindow()
  8. {
  9. InitializeComponent();
  10. for (int i = 0; i <= 32; i++)
  11. {
  12. TopBinaryPanel.Children.Add(new Label {Name = "Bin" + Convert.ToString(i), Content = 0});
  13. BotBinaryPanel.Children.Add(new Label {Name = "Bin" + Convert.ToString(31+i), Content = 0});
  14. }
  15. }
  16.  
  17. private void TopBinaryPanel_MouseDown(object sender, MouseButtonEventArgs e)
  18. {
  19. Label ChildElem = (Label)e.Source;
  20. bool PinVal = Convert.ToBoolean(ChildElem.Content);
  21. ChildElem.Content = Convert.ToInt16(!PinVal);
  22. int index = Convert.ToInt32(ChildElem.Name.Substring(3));
  23. ValueMass[index] = Convert.ToInt32(ChildElem.Content);
  24. string textes = string.Concat<int>(ValueMass);
  25. Tablo.Text = textes;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment