![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Geometry path relative to edges of Grid or Canvas I am trying to draw a rectangle with 2 radiused corners, that will fill the grid into which it is placed. As I only want 2 radiused corners I can't use a std rectangle. All the samples I have seen use constant values for the coordinates in the geometry path and I can't seem to use "Margin" or "Grid.Left" tricks in this instance. Any suggestions ? Thanks -- Griff (trying to make an industrial UI with XAML/WPF/c#) |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Geometry path relative to edges of Grid or Canvas Some ideas: 1. Use 3 rectangles, one will be with corners, the other two will hide 2 of the corners <Grid> <Rectangle RadiusX="10" RadiusY="10" Fill="Blue"/> <Rectangle Margin="10,10,0,0" Fill="Blue"/> <Rectangle Margin="0,0,10,10" Fill="Blue"/> </Grid> 2. Divide the space using a grid with 3 rows and 3 columns. The widts(heights) for columns(rows) will be 10,*,10 and put the appropriate figures in its cells 3. Make a custom control which will contain a Path. Override Measure/Arrange and modify the Path points in it. -- Valentin Iliescu [MVP C#] "Griff" wrote: > I am trying to draw a rectangle with 2 radiused corners, that will fill the > grid into which it is placed. As I only want 2 radiused corners I can't > use a std rectangle. > > All the samples I have seen use constant values for the coordinates in the > geometry path and I can't seem to use "Margin" or "Grid.Left" tricks in this > instance. > > Any suggestions ? > > Thanks > > > -- > Griff > (trying to make an industrial UI with XAML/WPF/c#) |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Geometry path relative to edges of Grid or Canvas > 1. Use 3 rectangles, one will be with corners, the other two will hide 2 of > the corners > <Grid> > <Rectangle RadiusX="10" RadiusY="10" Fill="Blue"/> > <Rectangle Margin="10,10,0,0" Fill="Blue"/> > <Rectangle Margin="0,0,10,10" Fill="Blue"/> > </Grid> This unfortunately is not an option, as the shape is to be used for a shadow with about 50% Alpha. Overlapping shapes makes a double density shadow. > > 2. Divide the space using a grid with 3 rows and 3 columns. The > widts(heights) for columns(rows) will be 10,*,10 and put the appropriate > figures in its cells This is definitely the answer in this case ! Many thanks. > 3. Make a custom control which will contain a Path. Override Measure/Arrange > and modify the Path points in it. For a solid shape this may not be necessary, but where I want the actual outline this may prove necessary. > -- > Valentin Iliescu [MVP C#] > > > "Griff" wrote: > > > I am trying to draw a rectangle with 2 radiused corners, that will fill the > > grid into which it is placed. As I only want 2 radiused corners I can't > > use a std rectangle. > > > > All the samples I have seen use constant values for the coordinates in the > > geometry path and I can't seem to use "Margin" or "Grid.Left" tricks in this > > instance. > > > > Any suggestions ? > > > > Thanks > > > > > > -- > > Griff > > (trying to make an industrial UI with XAML/WPF/c#) |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Relative Path Completion | PowerShell | |||
| How is relative path resolution done by cmdlets? | PowerShell | |||
| BUG? (Test-Path $path -IsValid) and empty $path | PowerShell | |||