Products Technologies Demo Docs Blog Support Company

Displaying a Frame Around a Paragraph

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,…

Displaying a Frame Around a Paragraph

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

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

Windows FormsWPF.NET

Create a Table of Contents in Windows Forms using C#

This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.


Windows FormsList.NET

Two Ways to Restart Numbered Lists in TX Text Control

In TX Text Control, numbered lists are continued by default and need to be reset when required. There is more than one way if you want to restart numbered lists in a document. In this article, two…


.NETSample

Paste Special: The Easy Way to Implement

In an older sample, I showed how to implement a paste special functionality by accessing the clipboard directly using .NET functionality. In version 15.0, we implemented this functionality…


.NETSampleSections

How to Remove All Section Breaks in a Document?

With version 14.0, we introduced document section breaks that allow you to have different page formats in the same document. Version 15.0 implements page columns that can be adjusted section-wise.…


.NETPrintingSample

Batch Printing: How to Print Documents in One Print Job

A typical requirement when printing loads of documents is managing the print jobs. A group of separate documents might be subsumed in a single print job. We just published a new sample in our…