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.

Set the Fill and Stroke brushes

Set the Fill and Stroke brushes

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

Start my 1-month free trial

Set the Fill and Stroke brushes

- [Instructor] In WPF, you paint the parts of the UI with a brush. It's noted for shapes. In shapes you have two places that are paintable or two properties that you can paint with, that's the Fill property and the Stroke property. In this example, I have an ellipse that has neither one of them set, so, currently, you can't even see the ellipse here. But, of course, you can select it in the XAML editor and it shows up as selected or I can click with my mouse over here to select it. One simple way of changing the properties, what you've seen me do in lots of other demos, is type in "fill" and choose from this drop down list like that and now I've got two brushes. One on the Stroke and one on the Fill. I'll make the Stroke thickness bigger so it's easier to see. That's one way of doing it, but I also like to work with the property editor in Visual Studios so let's use that for the rest of the demo. So, I'll select my ellipse, then I'll go to View and choose Properties, and, then, on my…

Contents