Diagonal Rectangle/ Size of Canvas  
Author Message
wadnerk





PostPosted: Windows Presentation Foundation (WPF), Diagonal Rectangle/ Size of Canvas Top

I'm trying to draw a rounded rectange from one corner of a canvas to the other. (ie top-left to bottom-right). I thought this would be fairly simple, but I can't figure out how to get the size of the canvas to control the rectangle length.

How would I go about doing that

-- Big Picture ---
Word Search program where a each Grid cell contains a TextBlock, I'm trying to draw a rectangle diagonally around a word. I've marked the region with a Canvas going from the top left cell to the bottom right..
-----------------------

====
Kiel


Visual Studio 200836  
 
 
Unni Ravindranathan - MSFT





PostPosted: Windows Presentation Foundation (WPF), Diagonal Rectangle/ Size of Canvas Top

Canvas only arranges elements, it does not size them. One option is to give a Width and Height to the Rectangle being displayed inside the Canvas. The other option is to use a Grid which would stretch the Rectangle by default.

Thanks,
-Unni



 
 
SpringRainSoft





PostPosted: Windows Presentation Foundation (WPF), Diagonal Rectangle/ Size of Canvas Top

I'm afraid I mustn't of described my problem well enough. Thanks though for the reply Unni. I ended up finding a totally different way of solving my problem