Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.
« »

Displaying a frame around a paragraph

Blogged by Björn Meyer on April 18, 2005 and tagged with Samples, .NET.

Today, I am going to show you how to display a frame around a paragraph. Users often request this as a new feature for a future version as they are not aware that this is already implemented in TX Text Control. They also tried to simulate it using tables (which is possible as well).

A frame can be specified in the ParagraphFormat class using 4 different settings:

Frame: This sets the frame around a paragraph. You could specify whether the frame is a box or just a line at the left, right, bottom or top of the paragraph. Additionally, the Frame property offers a possibility to specify a merged box. In this case, the paragraph has got a complete frame. If the following paragraph has a frame too, the frames are merged to a single boxed frame.

FrameDistance: Sets the distance between the text and the frame.

FrameLineWidth: Sets the width of the frame lines.

FrameStyle: Specified whether the frame is displayed as a single or a double line.

The following sample code inserts a double lined frame to the current paragraph.

Dim myFrameStyle As New TXTextControl.ParagraphFormat

myFrameStyle.Frame = TXTextControl.Frame.Box
myFrameStyle.FrameDistance = 200
myFrameStyle.FrameLineWidth = 50
myFrameStyle.FrameStyle = TXTextControl.FrameStyle.Double

TextControl1.ParagraphFormat = myFrameStyle
« Prev:Exporting password protected PDF documents
» Next:TX Text Control on DotNetJunkies.com

Comments

If you would like to comment on this blog entry, please post a comment.

Posted by Mark Hatten on Tuesday, April 19, 2005 at 07:58:52:

Thanks for the tip off. That is a nice feature. I have already added the search results of XML, GIF and PDF to my RSS client.

Posted by Henry James on Tuesday, November 22, 2005 at 08:16:32:

Good idea. I like that. It is *very* useful to get search results in my feed browser.

Posted by Ravi Selvaraj on Monday, October 20, 2008 at 21:36:50:

When you save the output in rtf format and open in Tx Text Control Words application it works fine. But attempting to open the rtf file in Microsoft word the paragraph frame is set to right line and bottom line even if you didnt set the bottom line.
I am not sure if this is a bug or I am missing something.
External verification page for ISO 9000:2000 certificate
ISO 9001:2000
certified