![]() |
Why Markup Static doesn't word wrap? |
Post Reply
|
| Author | |
JohnLutz
Newbie
Joined: 20 May 2008 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: Why Markup Static doesn't word wrap?Posted: 22 May 2008 at 6:16pm |
|
Why doesn't the text wrap in my static Markup? Here's the XAML...
CString stackPanel = _T("<StackPanel Orientation='Horizontal'>"); CString image = _T("<Image Source='res://info.bmp' VerticalAlignment='Center'/>"); CString margin = _T("<StackPanel Margin='5, 0, 0, 0'>"); CString caption; caption.Format(_T("<TextBlock TextAlignment='Left' FontWeight='Bold' TextWrapping='Wrap'>%s</TextBlock>"), captionStr); CString note; note.Format(_T("<TextBlock TextAlignment='Left' TextWrapping='Wrap'>%s</TextBlock>"), noteStr); CString ending = _T("</StackPanel></StackPanel>"); CString text = stackPanel; text += image; text += margin; text += caption; text += note; text += ending; SetMarkupText(text); |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 2008 at 1:28am |
|
HI,
because this text located in Horizontal StackPanel. Horizontal StackPanel have INT_MAX width.
you have to replace it to Grid.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
JohnLutz
Newbie
Joined: 20 May 2008 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 2008 at 10:27am |
|
I tried a grid and it still doesn't wrap...
_T("<Border BorderThickness='1' BorderBrush='#808080'>") _T("<Grid>") _T("<Grid.ColumnDefinitions><ColumnDefinition Width='Auto'/><ColumnDefinition Width='Auto'/></Grid.ColumnDefinitions>") _T("<Grid.RowDefinitions><RowDefinition/><RowDefinition/></Grid.RowDefinitions>") _T("<Border Padding='3' Grid.Column='0' Grid.Row='0' BorderThickness='1' Background='#e0e0e0' BorderBrush='#808080'><TextBlock Text='caption:'/></Border>") _T("<Border Padding='3' Grid.Column='0' Grid.Row='1' BorderThickness='1' Background='#e0e0e0' BorderBrush='#808080'><TextBlock Text='note:'/></Border>") _T("<Border Padding='3' Grid.Column='1' Grid.Row='0' BorderThickness='1' Background='White' BorderBrush='#808080'><TextBlock Text='%s' FontWeight='Bold' TextWrapping='wrap'/></Border>") _T("<Border Padding='3' Grid.Column='1' Grid.Row='1' BorderThickness='1' Background='White' BorderBrush='#808080'><TextBlock Text='%s' TextWrapping='wrap'/></Border>") _T("</Grid>") _T("</Border>"), |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 2008 at 3:42pm |
|
Hi, try
_T("<Grid.ColumnDefinitions><ColumnDefinition Width='Auto'/><ColumnDefinition Width='*'/></Grid.ColumnDefinitions>")
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |