Print Page | Close Window

Why Markup Static doesn't word wrap?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=10752
Printed Date: 15 November 2025 at 4:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Why Markup Static doesn't word wrap?
Posted By: JohnLutz
Subject: Why Markup Static doesn't word wrap?
Date 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);




Replies:
Posted By: Oleg
Date 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


Posted By: JohnLutz
Date 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>"),



Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net