From the course: Windows Presentation Foundation 5: Interaction and Controls

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Work with the line shape

Work with the line shape

From the course: Windows Presentation Foundation 5: Interaction and Controls

Start my 1-month free trial

Work with the line shape

- [Instructor] The line class is one of the simplest shapes you can work with. I've got two lines drawn inside this page. I've got an orange line on the left side of the screen, and I've got this blue line, here. Here's how you draw one. Use the line class, and you specify some values. Now before I go too far, let's look at this top line which says fill equal red. The line is a shape class and at the shape class level, is a property called Fill. It doesn't make sense to have fill for a line, it just has a stroke but because it's inherited from the base classes here. You see I've set it to red but if you look over here in the designer, there's no red. It's ignored. That means I can remove this and it will have no impact. Next on line 14, I'm setting the stroke to orange setting the stroke thickness on line 15 and then I'm specifying the starting and ending points. I didn't specify the start point so it's using 0,0 as the starting point. So, that's here up in the upper left hand corner.…

Contents