KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to draw a line on a WPF Grid. private void InitializeTestline() { testline = new Line(); grid.Children.Add(testline); testline.X1 = 0; testline.X2 = 1; testline.Y1 = 0; testline.Y2 = 1; testline.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; testline.VerticalAlignment = System.Windows.VerticalAlignment.Top; testline.Stroke = Brushes.Red; testline.Stretch = Stretch.Fill; testline.StrokeThickness = 2; testline.Visibility = System.Windows.Visibility.Visible; } It is drawn without problems. But now i want to add four buttons to the grid (up, down, left, right). So when i press one of the buttons the line should move in the direction i choose. private void MoveUp_Click(object sender, RoutedEventArgs e) { this.testline.Y1 += move; this.testline.Y2 += move; } This was the function i want to use for this, but it doesn't work. So how it is possible to move this line? In end I have a gui like an old terminal3270 and these gui has a caret. the lines should be like a crosshair (and help to see where the caret actually is)
Tags (comma-separated)
Save Edits
Cancel