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
From the course: Windows Presentation Foundation 5: Interaction and Controls
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
-
-
-
-
-
-
-
Overview2m 50s
-
Use the Shape Stretch property3m 34s
-
Set the Fill and Stroke brushes6m 25s
-
Work with the line shape3m 33s
-
Work with Polyline and Polygon6m 45s
-
Use the StrokeDashArray and EndCap properties4m 52s
-
Create drawings with Path5m 49s
-
Use Blend for Visual Studio to draw a Path5m 24s
-
Hit testing with geometries4m 2s
-
-
-
-
-
-
-
-