Exercise 5: RichTextBox
One way we could enhance user registration would be to enable users to supply some sort of text about themselves—if we wanted to add some sort of forum system to the site, the ability to provide a more detailed online identity would be important. We could add a simple text box to hold such information, but that’s a little limited. It might be better to use the RichTextBox added in Silverlight 4, which provides a way to display and edit formatted text—unlike the plain TextBox, the edited text can contain a mixture of plain, bold, or italic text, with different font sizes, colors, and typefaces if you choose. And the RichTextBox offers a read-only mode enabling such formatted text to be displayed easily. (It was possible to render formatted text in earlier versions of Silverlight, but the RichTextBox makes it much easier.)
In fact we could use this feature in other places. For example, the event description itself is currently just plain text, but could be enhanced with the use of more flexibly styled text. Since the RichTextBox is very broadly applicable, this part of the lab will look at it in isolation, rather than wiring it into a specific part of the example application, so that we can focus on the details of using the RichTextBox itself.
In Visual Studio 2010, press Ctrl+Shift+N, or use the File→New→Project... menu item.
Add New Silverlight Application Project
Programming the RichTextBox