Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace WpfApplication1
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public Label l = new Label();
- public MainWindow()
- {
- InitializeComponent();
- TextBlock_fullText.Foreground = Brushes.White;
- Thickness margin = TextBlock_fullText.Margin;
- margin.Left = 0;
- margin.Top = 0;
- TextBlock_fullText.Margin = margin;
- Rectangle r = new Rectangle();
- r.Width = 200;
- r.Height = 20;
- SolidColorBrush whiteBrush = new SolidColorBrush(Colors.Blue);
- r.Fill = whiteBrush;
- l.Width = 100;
- l.Height = 100;
- l.Content = "nic";
- l.Margin = new Thickness(100,100,0,0);
- canv.Children.Add(r);
- canv.Children.Add(l);
- }
- protected override void OnKeyDown(KeyEventArgs e)
- {
- if (e.Key == Key.Left)
- {
- l.Content = "doleva";
- }
- else if (e.Key == Key.Right)
- {
- l.Content = "doprava";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement