The following forum(s) have migrated to Microsoft Q&A: Windows Presentation Foundation (WPF)! Visit Microsoft Q&A to post new questions.
Hello everyone!
I have TextBlock which looks like this:
How is it possible to stretch my Text in the TextBlock to the size of the TextBlock? I have tried it with the Property HorizontalAlignment, but nothing happens.
Could anyone help me?
When you set TextBlock.HorizontalAlignment to Stretch (which is the default value) you're stretching the TextBlock, not its content.
To achieve the behavior you're looking for, you'll have to code a Control of your own. If I have time for it, I'll post a sample.
Oh, thanks a lot for your answer!
Yeah, a sample would be nice.