HTML5 and CSS3 enabled 3D web experience at roomsay.com:

RoomSay.com 3D Web Experience RoomSay.com 3D Web Experience DIY

Vectorlight News

  • 3D CSS used to Create Website
    Feb 08, 2014

    With the CSS 3D effects being implemented in modern browsers RoomSay.com takes this new technology and enables you to map your traditional 2D content onto the walls of a 3D room.

  • Chat App Converted to HTML and JQuery
    Sep 08, 2011

    Converted from Silverlight to HTML and Javascript/JQuery is the Vectorlight Chat App. Login using your Vectorlight password to chat using your username and avatar.

  • HTML5 iPhone,Android Big Guns Tower Defense
    Jul 02, 2011

    Big Guns has made the leap from Windows Phone 7 (XNA) to HTML5 so you can now play it on your iPhone, Android and other HTML5 compatible devices.

  • HTML5 Games - Word Poppers and Batty
    Jun 04, 2011

    As the take-up of HTML5 quickens (74% of users currently have a browser capable of HTML5 Canvas) we present two more games for both your browser and mobile.

  • Big Guns Tower Defense on Windows Phone 7
    May 06, 2011

    Coming soon to Windows Phone 7 is an XNA port of the popular Vectorlight tower defense game Super Tower Defense. Whilst retaining many of the graphical and gameplay features of the original Silverlight game.

  • Home Page News
RTB Auto-shrinking still not working? Layoutcycle-Crash Posted: Apr 04, 2010


First of all, thank you very much for your great controls.

Secondly: I'm having some trouble when trying to fit a Richtextbox's height to it's content. Since it seems to me that the RTB is just growing but not shrinking automatically I'm using something similar to what has been suggested in this thread:


So in the contentchanged event of my Rich TextBox I have something like this where txt is the RTB:

        Dim TextHeight As Double = Math.Round(txt.Panel.Height + 8)           ' +8 for the Lineheight

        If txt.ActualHeight > TextHeight Then

            txt.Height = TextHeight

        ElseIf txt.ActualHeight < TextHeight Then

            txt.Height = Double.NaN

        End If

The Textbox resides within a Stackpanel (together with a Checkbox) within a Grid (Gridrow 0, Rowheight set to auto). Gridrow 1 is a Row used for spacing (Height set to Star) and Gridrow 2 has the same setup as Row 0.

The Problem now is: After the RTB-Content has resized for a few times (i.e. by changing the Font-Size), at some point (presumably when setting the Height to auto again) my Application crahes with a "Layoutcycle". I read somewhere that a large number of Textboxes might cause this, though this cannot be the cause in my case, as I only have two of them in this grid and just a few more on the rest of the page.

When I leave out the autosizing though, and stick to always setting the Textbox height to it's Panel Height (+ some lineheight) whenever the content is changed, then after the Textbox' Content gets wrapped, the new line's characters somehow get invisible until I i.e. manually insert a new line by hitting the enter key.

So in short: either my App chrashes after a while, or the Textbox won't shrink to it's content or I'll have to find some strange workaround to get wrapped Lines visible again programatically, which I haven't managed so far.

Anyone can help me out with this?

Many thanks,


RE: RTB Auto-shrinking still not working? Layoutcycle-Crash Posted: Apr 13, 2010

Sorry to bumb this thread, but I'm having a little trouble with getting this to work...

Is there no recommended way of fitting a Richtext Box' height to it's content (given the content is editable by the user)?

- When setting the RichTextBox-Height to it's Panel-Height in the ContentChanged event characters are disappearing after a wrap.

- When setting the height to Auto the RT-Box will grow but not shrink.

- And when combining the two methods my app crashes with a layout cycle after a few edits.

Any ideas?

Thank you very much in advance.

RE: RTB Auto-shrinking still not working? Layoutcycle-Crash Posted: Jan 27, 2012

I have the same Problem.

My RTB is hosted in a Silverlight Accordion control.