SIGN UP MEMBER LOGIN:    
ARTICLE

RichTextBox in Silverlight 4

Posted by Shankey Articles | Silverlight November 21, 2010
In this article you will learn how to use RichTextBox in Silverlight 4.
Reader Level:
Download Files:
 

Following are the feature of rich text box control

  • Rich content - multimedia
  • Inline images
  • Formatted text
  • Hyperlinks

Rich text box offer two modes

  • Editing mode which is by default.
  • Read only mode which can be set by using IsReadOnly="True"

    image1.gif


Note: The hyperlinks will work only if IsReadOnly property is set to true.

Main Page

Following image shows how the page looks with rich text box.

image2.gif

To set the content of RichTextBox control you can use Paragraph element as shown below

image3.gif

Hyperlink

To show the hyperlink you can use the Hyperlink element. The hyperlink will navigate only if the rich text box is in read only mode i.e. isReadOnly=True

image4.gif

UIElement

To show the text with the inline UIElement object like image as shown below

image5.gif

Left Alignment

To change the alignment to left or start typing from left, then select the text and click on the left button. As shown below

image6.gif

For this use the following code:

image7.gif

Center Alignment

To change the alignment to center or start typing from center, then select the text and click on the center button. As shown below.

image8.gif

For this use the following code:

image9.gif

Right Alignment

To change the alignment to right or start typing from right, then select the text and click on the right button. As shown below.

image10.gif

For this use the following code:

image11.gif

Bold

To make the text bold, then first select the text and click on the bold button. As shown below:

image12.gif

For this use the following code:

image13.gif

Italic

To make the text italic, then first select the text and click on the italic button. As shown below:

image14.gif

For this use the following code:

image15.gif

Underline

To make the text underline, then first select the text and click on the underline button. As shown below:

image16.gif

For this use the following code:

image17.gif

Wrap / Unwrap

To wrap the content, then check wrap checkbox. As shown below:

image18.gif

To remove wrap, then uncheck wrap checkbox. As shown below:

image19.gif

For this use the following code:

image19.1.gif

Load image

To load multimedia content like image, specify the location of the image and then click load button. As shown below.

image20.gif

For this use the following code:

image21.gif
 

share this article :
post comment
 

Hi, i working on silverlgith control. at present im working HTML Editor using silverlight, Here im adding images to richtextbox dyanmically. after addingimages i need to move image inside richtextbox. im using VS2010 and Silverlight4 Please help me out in this. Regards, Naresh

Posted by naresh p Jan 25, 2011

how to move image inside richtextbox

Posted by naresh p Jan 20, 2011
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Nevron Gauge for SharePoint
Become a Sponsor