views:

293

answers:

2

I have a textblock in a grid in WPF.

I want the text to dynamically size (font) when resized. At the moment textboxes, comboboxes do this, but the the textblock stays the same. Is it possible?

+1  A: 

Instead of trying to manually rig a TextBlock to do this, just edit the default template of a TextBox and remove the border and background, then in the style make it set the IsReadOnly flag. This way you get the textblock sizing, as well as copy-paste for free.

Paul Betts
where do you edit default templates?
baron
Use Expression Blend "Edit Template", or if you've only got VS, it's at http://pastie.org/714760
Paul Betts
A: 

use expression blend for getting the default template of TextBox, then you can edit it as you required.

viky