Text crawl in Blend?Hello,<br><br>does anybody have an idea how to make text crawl in Blend? (one you can see many on TV news etc)<br><br>Crawl should be bind to external data and live updated on air.<br><br>Any help or idea (can i use some other tools with Blend?) is greatly appreciated.<br><br>Thank you in advance.<br><br>P.S. Not an native English speaker so sorry for any errors!<br>© 2009 Microsoft Corporation. All rights reserved.Sun, 23 Nov 2008 03:33:42 Z8fd03c38-438a-44fa-9845-067131041b63http://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#8fd03c38-438a-44fa-9845-067131041b63http://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#8fd03c38-438a-44fa-9845-067131041b63Modinaddrhttp://social.expression.microsoft.com/Profile/en-US/?user=ModinaddrText crawl in Blend?Hello,<br><br>does anybody have an idea how to make text crawl in Blend? (one you can see many on TV news etc)<br><br>Crawl should be bind to external data and live updated on air.<br><br>Any help or idea (can i use some other tools with Blend?) is greatly appreciated.<br><br>Thank you in advance.<br><br>P.S. Not an native English speaker so sorry for any errors!<br>Wed, 05 Mar 2008 08:31:22 Z2008-03-05T08:31:22Zhttp://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#7c89d543-57f1-406f-8bf1-89daa84128e9http://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#7c89d543-57f1-406f-8bf1-89daa84128e9Viniciushttp://social.expression.microsoft.com/Profile/en-US/?user=ViniciusText crawl in Blend?<p class=MsoNormal style="margin:0cm 0cm 10pt"><span lang=EN-US style=""><font size=3><font color="#000000"><font face=Calibri>Can you be more specific or give some example?</font></font></font></span></p>Fri, 07 Mar 2008 01:13:09 Z2008-03-07T01:13:09Zhttp://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#7a79ed64-e87f-49f5-ac64-5b866db0d521http://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#7a79ed64-e87f-49f5-ac64-5b866db0d521Modinaddrhttp://social.expression.microsoft.com/Profile/en-US/?user=ModinaddrText crawl in Blend?Text crawl is what you often see on TV when you watch your favorite news and there is some additional (text) info crawling in the lower third of the screen - typical. What I am working on is very similar. It is an automatized application for TV where you can interactively add your info over SMS to application to be displayed as text crawl. We already have an application for exporting SMSes into XML.<br>My problem is I don't even know how to start solving this problem in Blend. I don't know if this should be done in some other environment or what :S . I thought about animate endless text block but I think this would lag application over time.. I am clueless at the moment.<br><br>I hope this helps understand my problem a little, and I really need some help.<br><br>Thank you<br><br>Fri, 07 Mar 2008 08:12:49 Z2008-03-07T08:12:49Zhttp://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#15708348-7999-4628-9259-ed9caa086140http://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#15708348-7999-4628-9259-ed9caa086140Adrian Vinca MSFThttp://social.expression.microsoft.com/Profile/en-US/?user=Adrian%20Vinca%20MSFTText crawl in Blend?Hi,<br><br>I haven't created any such control but here are some thoughts:<br>I think you should create your own control (e.g. TextCrawlControl) - this requires some more advanced knowledge of WPF and you may need to write some code. You could try different ways to implement the control:<br><br>1. Have custom code which creates/destroys the items you want to display<br>- use a series of TextBlocks you animate right to left<br>- dynamically add new TextBlocks, on the right side, in the invisible area of the screen - you could create them every time a new word or sentence needs to enter the screen<br>- the control keeps tracks of all the TextBlocks and moves them to the left for every iteration; when a TextBlock reaches the left side, it gets removed from its parent (so that it gets destroyed)<br>- the control could expose properties for Speed, Font Size, Font Family, perhaps a queue of items to be displayed<br><br>2. Try using VirtualizingStackPanel. Its behavior is very similar to your scenario (it shows a list of items, uses virtualization): <br><br><a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.virtualizingstackpanel.aspx">http://msdn2.microsoft.com/en-us/library/system.windows.controls.virtualizingstackpanel.aspx</a><br><br>Hope this helps,<br>Adrian<br><br>- Adrian Vinca [MSFT]<br>Content is provided &quot;AS IS&quot; with no warranties and confers no rights. Opinions are my own and do not represent those of my employer. <br><br>Fri, 07 Mar 2008 11:03:29 Z2008-03-07T11:03:29Zhttp://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#46719f1f-39c9-4c47-9977-226c00afd3fbhttp://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#46719f1f-39c9-4c47-9977-226c00afd3fbModinaddrhttp://social.expression.microsoft.com/Profile/en-US/?user=ModinaddrText crawl in Blend?Thank you alot Adrian, this is very helpfull. At least i know where to look further :) and i see the problem is not the easy one. Thank you again,<br><br>Zoran<br>Mon, 10 Mar 2008 10:41:19 Z2008-03-10T10:41:19Zhttp://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#6d99fba9-826d-40f4-be56-68f69afd2c25http://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#6d99fba9-826d-40f4-be56-68f69afd2c25BalaMurugan_Sahttp://social.expression.microsoft.com/Profile/en-US/?user=BalaMurugan_SaText crawl in Blend?<p>Hi Modinaddr,<br><br>I tried a bit to create an user control called 'CrawlTextBox'.  <br><br>Please find below the Code... Hope this will help you.<br><br>------------------------------------------------------------------------------------------------------------------------<br>XAML Code - UserControl<br>------------------------------------------------------------------------------------------------------------------------<br><font color="#0000ff" size=2>&lt;</font><font color="#a31515" size=2>UserControl<br></font><font color="#ff0000" size=2>xmlns</font><font color="#0000ff" size=2>=&quot;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&quot;<br></font><font color="#ff0000" size=2>xmlns</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>x</font><font color="#0000ff" size=2>=&quot;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&quot;<br></font><font color="#ff0000" size=2>xmlns</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>d</font><font color="#0000ff" size=2>=&quot;<a href="http://schemas.microsoft.com/expression/blend/2008">http://schemas.microsoft.com/expression/blend/2008</a></font><font color="#ff0000" size=2>&quot;<br>xmlns</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>mc</font><font color="#0000ff" size=2>=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;</p> <p></font><font color="#ff0000" size=2>mc</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Ignorable</font><font color="#0000ff" size=2>=&quot;d&quot;<br></font><font color="#ff0000" size=2>x</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Class</font><font color="#0000ff" size=2>=&quot;TextCrawl.CrawlTextBox&quot;<br></font><font color="#ff0000" size=2>x</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Name</font><font color="#0000ff" size=2>=&quot;UserControl&quot;<br></font><font color="#ff0000" size=2>d</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>DesignWidth</font><font color="#0000ff" size=2>=&quot;640&quot;</font><font color="#ff0000" size=2> d</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>DesignHeight</font><font color="#0000ff" size=2>=&quot;480&quot;&gt;</p> <p></font><font color="#a31515" size=2> </font><font color="#0000ff" size=2>&lt;</font><font color="#a31515" size=2>DockPanel</font><font color="#ff0000" size=2> LastChildFill</font><font color="#0000ff" size=2>=&quot;False&quot;</font><font color="#ff0000" size=2> Height</font><font color="#0000ff" size=2>=&quot;32&quot;</font><font color="#ff0000" size=2> Width</font><font color="#0000ff" size=2>=&quot;288&quot;</font><font color="#ff0000" size=2> HorizontalAlignment</font><font color="#0000ff" size=2>=&quot;Left&quot;</font><font color="#ff0000" size=2> VerticalAlignment</font><font color="#0000ff" size=2>=&quot;Top&quot;&gt;<br></font><font color="#0000ff" size=2>&lt;</font><font color="#a31515" size=2>TextBox</font><font color="#ff0000" size=2> Text</font><font color="#0000ff" size=2>=&quot;TextBox&quot;</font><font color="#ff0000" size=2> TextWrapping</font><font color="#0000ff" size=2>=&quot;Wrap&quot;</font><font color="#ff0000" size=2> DockPanel.Dock</font><font color="#0000ff" size=2>=&quot;Top&quot;</font><font color="#ff0000" size=2> Height</font><font color="#0000ff" size=2>=&quot;32&quot;</font><font color="#ff0000" size=2> x</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Name</font><font color="#0000ff" size=2>=&quot;displayTextBox&quot;/&gt;<br></font><font color="#0000ff" size=2>&lt;/</font><font color="#a31515" size=2>DockPanel</font><font color="#0000ff" size=2>&gt;</p> <p>&lt;/</font><font color="#a31515" size=2>UserControl</font><font color="#0000ff" size=2>&gt;<br></font>------------------------------------------------------------------------------------------------------------------------<br></p><font color="#0000ff" size=2> <p>--------------------------------------------------------------------------------------<br>CodeBehind(C#) of UserControl <br>--------------------------------------------------------------------------------------<br>using</font><font size=2> System.Windows.Threading;<br></font><font color="#0000ff" size=2>namespace</font><font size=2> TextCrawl<br>{<br></font><font color="#0000ff" size=2>public</font> <font color="#0000ff" size=2>partial</font> <font color="#0000ff" size=2>class</font> <font color="#2b91af" size=2>CrawlTextBox<br>    </font><font size=2>{</p> <p></font><font color="#0000ff" size=2>    private</font> <font color="#2b91af" size=2>DispatcherTimer</font><font size=2> timer;    <br>    </font><font color="#0000ff" size=2>public</font><font size=2> CrawlTextBox(){<br></font><font color="#0000ff" size=2>        this</font><font size=2>.InitializeComponent();<br>        </font><font size=2>Loaded += </font><font color="#0000ff" size=2>new</font> <font color="#2b91af" size=2>RoutedEventHandler</font><font size=2>(CrawlTextBox_Loaded);<br>        displayString = </font><font color="#a31515" size=2>&quot;I love WPF. I love SliverLight. I love Coding &quot;</font><font size=2>;<br>        displayStringWidth = 15;<br>        interval = 100;<br>    }<br></p> <p></font><font color="#0000ff" size=2>// This will contain the Displaying text<br>private</font> <font color="#0000ff" size=2>string</font><font size=2> displayString;<br></font><font color="#0000ff" size=2>public</font> <font color="#0000ff" size=2>string</font><font size=2> DisplayString{</font><font color="#0000ff" size=2>get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> displayString; }</font><font color="#0000ff" size=2>set</font><font size=2> { displayString = </font><font color="#0000ff" size=2>value</font><font size=2>; }}</p> <p></font><font color="#0000ff" size=2>// Specify the width of the text that need to shown on the screen<br>private</font> <font color="#0000ff" size=2>int</font><font size=2> displayStringWidth;</font><font color="#0000ff" size=2>public</font> <font color="#0000ff" size=2>int</font><font size=2> DisplayStringWidth{</font><font color="#0000ff" size=2>get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> displayStringWidth; }</font><font color="#0000ff" size=2>set</font><font size=2> { displayStringWidth = </font><font color="#0000ff" size=2>value</font><font size=2>; }}</p> <p></font><font color="#0000ff" size=2>// Specify the speed at which the text should crawl<br>private</font> <font color="#0000ff" size=2>double</font><font size=2> interval;<br></font><font color="#0000ff" size=2>public</font> <font color="#0000ff" size=2>double</font><font size=2> Interval{</font><font color="#0000ff" size=2>get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> interval; }</font><font color="#0000ff" size=2>set</font><font size=2> { interval = </font><font color="#0000ff" size=2>value</font><font size=2>; }}</p> <p></font><font color="#0000ff" size=2>private</font> <font color="#0000ff" size=2>char</font><font size=2> tempText;</p> <p></font><font color="#0000ff" size=2>private</font> <font color="#0000ff" size=2>bool</font><font size=2> enable;</p> <p></font><font color="#0000ff" size=2>public</font> <font color="#0000ff" size=2>bool</font><font size=2> Enable{</font><font color="#0000ff" size=2>get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> enable; }</font><font color="#0000ff" size=2>set</font><font size=2> { enable = </font><font color="#0000ff" size=2>value</font><font size=2>; }}</p> <p></font><font color="#0000ff" size=2>void</font><font size=2> CrawlTextBox_Loaded(</font><font color="#0000ff" size=2>object</font><font size=2> sender, </font><font color="#2b91af" size=2>RoutedEventArgs</font><font size=2> e)<br>{</p> <p>timer = </font><font color="#0000ff" size=2>new</font> <font color="#2b91af" size=2>DispatcherTimer</font><font size=2>();<br>timer.Interval = </font><font color="#2b91af" size=2>TimeSpan</font><font size=2>.FromMilliseconds(interval);<br>timer.Tick += </font><font color="#0000ff" size=2>new</font> <font color="#2b91af" size=2>EventHandler</font><font size=2>(timer_Tick);<br>timer.Start();</p> <p>}</p> <p></font><font color="#0000ff" size=2>void</font><font size=2> timer_Tick(</font><font color="#0000ff" size=2>object</font><font size=2> sender, </font><font color="#2b91af" size=2>EventArgs</font><font size=2> e)<br>{<br></font><font color="#0000ff" size=2>if</font><font size=2> (!CheckForContent() || enable==</font><font color="#0000ff" size=2>false</font><font size=2>)<br>    </font><font color="#0000ff" size=2>return</font><font size=2>;</p> <p>FormatText();<br>displayTextBox.Text = displayString.Substring(0,displayStringWidth);<br>}</p> <p></font><font color="#0000ff" size=2>private</font> <font color="#0000ff" size=2>void</font><font size=2> FormatText()<br>{</p> <p>tempText = displayString[0];<br>// Remove the first character of the string<br>displayString = displayString.Remove(0, 1);<br>// Add the removed string to the last position of the stirng.<br>displayString = displayString.Insert(displayString.Length, tempText.ToString());<br>}</p> <p></font><font color="#0000ff" size=2>private</font> <font color="#0000ff" size=2>bool</font><font size=2> CheckForContent()<br>{<br></font><font color="#0000ff" size=2>if</font><font size=2> (displayString.Length &lt; 1)<br></font><font color="#0000ff" size=2>    return</font> <font color="#0000ff" size=2>false</font><font size=2>;<br></font><font color="#0000ff" size=2>else<br></font><font color="#0000ff" size=2>    return</font> <font color="#0000ff" size=2>true</font><font size=2>;<br>}</p> <p>}</p> <p>}<br>-------------------------------------------------------------------------------------<br>Windows.XAML where this 'UserControl' is used.<br>-------------------------------------------------------------------------------------<br><font color="#0000ff" size=2></p> <p>&lt;</font><font color="#a31515" size=2>Window</p></font><font color="#0000ff" size=2> <p></font><font color="#ff0000" size=2>x</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Name</font><font color="#0000ff" size=2>=&quot;Window&quot;<br></font><font color="#ff0000" size=2>Title</font><font color="#0000ff" size=2>=&quot;Window1&quot;</p> <p></font><font color="#ff0000" size=2>Width</font><font color="#0000ff" size=2>=&quot;640&quot;</font><font color="#ff0000" size=2> Height</font><font color="#0000ff" size=2>=&quot;480&quot;</font><font color="#ff0000" size=2> xmlns</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>d</font><font color="#0000ff" size=2>=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;</font><font color="#ff0000" size=2> xmlns</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>mc</font><font color="#0000ff" size=2>=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;</font><font color="#ff0000" size=2> mc</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Ignorable</font><font color="#0000ff" size=2>=&quot;d&quot;</font><font color="#ff0000" size=2> xmlns</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>TextCrawl</font><font color="#0000ff" size=2>=&quot;clr-namespace:TextCrawl&quot;</font><font color="#ff0000" size=2> Loaded</font><font color="#0000ff" size=2>=&quot;Window_Loaded&quot;&gt;</p> <p></font><font color="#0000ff" size=2>&lt;</font><font color="#a31515" size=2>Grid</font><font color="#ff0000" size=2> x</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Name</font><font color="#0000ff" size=2>=&quot;LayoutRoot&quot;&gt;<br>    </font><font color="#0000ff" size=2>&lt;</font><font color="#a31515" size=2>TextCrawl</font><font color="#0000ff" size=2>:</font><font color="#a31515" size=2>CrawlTextBox</font><font color="#ff0000" size=2> HorizontalAlignment</font><font color="#0000ff" size=2>=&quot;Left&quot;</font><font color="#ff0000" size=2> VerticalAlignment</font><font color="#0000ff" size=2>=&quot;Top&quot;</font><font color="#ff0000" size=2>     <br>    x</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Name</font><font color="#0000ff" size=2>=&quot;runText&quot;</font><font color="#ff0000" size=2>    Loaded</font><font color="#0000ff" size=2>=&quot;crawlTextBox_Loaded&quot;/&gt;<br></font><font color="#a31515" size=2></font><font color="#0000ff" size=2>&lt;/</font><font color="#a31515" size=2>Grid</font><font color="#0000ff" size=2>&gt;</p> <p>&lt;/</font><font color="#a31515" size=2>Window</font><font color="#0000ff" size=2>&gt;<br><br>-------------------------------------------------------------------------------------<br><br>-------------------------------------------------------------------------------------<br>CodeBehind ( where is usercontrol is used)<br>-------------------------------------------------------------------------------------<br><font color="#0000ff" size=2></p> <p>public</font> <font color="#0000ff" size=2>partial</font> <font color="#0000ff" size=2>class</font> <font color="#2b91af" size=2>Window1<br></font><font size=2>{</p> <p></font><font color="#0000ff" size=2>    public</font><font size=2> Window1()<br>    {<br>        </font><font color="#0000ff" size=2>this</font><font size=2>.InitializeComponent(); <p></p></font><font color="#008000" size=2>        // Set the 'enable' property to true;<br></font><font size=2>        runText.Enable = </font><font color="#0000ff" size=2>true</font><font size=2>;<br>    }</p> <p></font><font size=2>}<br><br>-BALA.</p></font></font></font>Sat, 30 Aug 2008 11:07:16 Z2008-08-30T11:07:16Zhttp://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#9115b5d6-d438-4e9f-aae3-d0339f05b3a8http://social.expression.microsoft.com/Forums/en-US/blend/thread/8fd03c38-438a-44fa-9845-067131041b63#9115b5d6-d438-4e9f-aae3-d0339f05b3a8philipshhttp://social.expression.microsoft.com/Profile/en-US/?user=philipshText crawl in Blend? Nice job BalaMurugan!  Works nice but the words are a bit jumpy.  I came up with a solution that is very smooth:<br><br><a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7a391faa-8607-4c2b-84d4-4ee3bf55a679">http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7a391faa-8607-4c2b-84d4-4ee3bf55a679</a><br><br>     PhilTue, 09 Sep 2008 18:54:54 Z2008-09-17T15:13:41Z