Sometimes it is neccessary to display an element over TX Text Control at a specific position. In the ViewMode PageView, there is a gap between the pages and the left and right TX Text Control border.
The gap between the pages is 1 cm (0.39 inch), which is 567 twips.
The left and right gap is not more tricky. The page is always centered, so that you just have to subtract the page width from the TX Text Control control width.
Additionally, the width of a scrollbar should be included, if a vertical scrollbar has been enabled. This result must be divided by 2 to get the gap between the TX Text Control border and the beginning of the document.
Dim verticalGap As Integer Dim scrollBarWidth As Integer = 0 If TextControl1.ScrollBars.Vertical = ScrollBars.Vertical Then scrollBarWidth = 16 End If verticalGap = (TextControl1.Width - TextControl1.PageSize.Width + scrollBarWidth) / 2