WPF RichTextBox with no width set
Posted
by Mick
on Stack Overflow
See other posts from Stack Overflow
or by Mick
Published on 2008-12-08T20:56:21Z
Indexed on
2010/04/14
0:53 UTC
Read the original article
Hit count: 447
wpf
|richtextbox
I have the following XAML code:
<Window x:Class="RichText_Wrapping.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1">
<Grid>
<RichTextBox Height="100" Margin="2" Name="richTextBox1">
<FlowDocument>
<Paragraph>
This is a RichTextBox - if you don't specify a width, the text appears in a single column
</Paragraph>
</FlowDocument>
</RichTextBox>
</Grid>
... If you create this window in XAML, you can see that when you don't specify a width for the window, it wraps the text in a single column, one letter at a time. Is there something I'm missing? If it's a known deficiency in the control, is there any workaround?
Thanks,
Michael
© Stack Overflow or respective owner