RichTextBoxDesktop
Previous  Next

The RichTextBoxDesktop object provides the following methods and properties and has no events.


Methods

AddText(Text AS String) : Appends the text provided to the contents of the RichTextBoxDesktop object.

Clear : Clears all content from the RichTextBoxDesktop.

CopyImageToClipboard(Img AS Image) : Copies the specified image to the clipboard from where it may be pasted into a document. Image can be any source of an image in Basic4PPC. .e.g. Form.Image or ImageControl.Image or ImageList.Item(x) etc.

LoadFile(FilePath AS String) : Loads the contents of the specified file into the RichTextBoxDesktop object. Note that this will clear any existing content.

New1(FormName AS String, Left AS  Int32, Top AS Int32, Width AS Int32, Height AS Int32) : Creates a new RichTextBoxDesktop object on FormName of the specified size and at the specified position.

NewPage : Inserts a page break into the contents of the RichTextBoxDesktop object. This is equivalent to AddText(Chr(12)).

PageSetup : Causes the PageSetup dialog to be displayed where the user can set the options for printing the document. This method returns either cOK or cCancel depending upon how the user closed the dialog.

Paste() : Pastes anything on the Clipboard into the RichTextBoxDesktop object. If there is text on the Clipboard and it is formatted the formatting will be preserved.

PasteBitmap() : If there is a bitmap on the clipboard it will be pasted into the RichTextBoxDesktop object. No control is available over size so some experimentation will be necessary to get the required result.

PasteText() : Pastes unformatted  text from the Clipboard into the RichTextBoxDesktop object. If the text on the Clipboard is formatted the formatting will be removed.

Print : Print the document on the default printer. A print dialog is NOT displayed and printing starts immediately,

PrintDialog :  Causes a Print dialog to be displayed. A printer may be selected on which to print the document. This method returns either cOK or cCancel depending upon how the user closed the dialog.

PrintPreview : Opens a Print Preview dialog to enable the layout of a document to be checked before actually printing it. The document may be printed from this dialog.

SaveFile(FilePath AS String) : Saves the contents of the RichTextBoxDesktop object to an RTF formatted file of the name and on the path specified by FilePath. No default extension is assigned to the filename.

Tab: Inserts a tab into the contents of the RichTextBoxDesktop object. This is equivalent to AddText(Chr(9)). Tabs may be inserted at the start of a line or after existing text by inserting "Chr(9)" into a string at the required tab position(s). For example having declared "Tab = Chr(9) in Sub Globals :-
AddText(Tab & "some text or a variable" & Tab & "some more " & Tab & "etc.")


Properties

I signifies readable and O signifies settable

Alignment : Int 32 [I/O] : Specifies the alignment of subsequent text. 0 = left, 1 = Right, 2 = Centred.

BackColor : Int32 [I/O] : Specifies the background colour of subsequent text. This colour IS printed.

BackgroundColor : Int32 [I/O] : Specifies the background colour of the control. This colour is NOT printed.

Bold : Boolean [I/O] : If True specifies that the subsequent text is bold.

BottomMargin: Int32 [I/O] : Specifies the bottom margin of the document. May also be read back after displaying the PrintSetup dialog to store the users' choice.

Bulleted : Boolean [I/O] : If True specifies that the subsequent line of text is bulleted.

Color : Int32 [I/O] : Specifies the colour of subsequent text. This colour IS printed.

ControlRef : Control [I] : Returns a reference to the underlying RichTextBox control. This value may be used with the ControlEvents library to add events to this control.

DllVersion : Double [I] : The version number of this library.

Font : String [I/O] : The name of the font in which subsequent text will be rendered.

FontScript :  Int32 [I/O] :  A number specifying the script to be used when rendering the font. This is normally inherited from the underlying Operating System but for reference may be set as follows. 0 Western, 1 Default, 2 Symbol,128 Japanese, 161 Greek, 162 Turkish, 163 Vietnamese, 177 Hebrew, 178 Arabic, 186 Baltic, 204 Cyrillic, 238 Central European.     

FontSize : Int32 [I/O] : Specifies the size, in points, to render subsequent text.

HangingIndent : Int32 [I/O] : Specifies the distance between the left edge of the first line of text in the selected paragraph and the left edge of subsequent lines in the same paragraph.

Height : Int32 [I/O] : Specifies the height of the control.

Italic : Boolean [I/O] : If True specifies that the subsequent text is italicised.

Landscape : Boolean [I/O] : If set True specifies that the document is printed in landscape format. May also be read back after displaying the PrintSetup dialog to store the users' choice.

Left : Int32 [I/O] : Specifies the distance, in pixels, between the left edge of the control and the left edge of its' parent form.

LeftIndent : Int32 [I/O] : Specifies the distance in pixels between the left edge of the control and the left edge of subsequent text.

LeftMargin: Int32 [I/O] : Specifies the left margin of the document. May also be read back after displaying the PrintSetup dialog to store the users' choice.

Offset : Int32 [I/O] : Specifies the vertical displacement, up (positive) or down (negative), of subsequent text. The default is 0. This allows super and sub-script text to be generated.

PageSetupMetric : Boolean [I/O] : This is set true by default. If using Imperial measurements and problems are experienced with user entered margin settings then try setting this false.

PrintPreviewHeight : Int32 [I/O] : Specifies the height of the PrintPreview dialog.

PrintPreviewLeft : Int32 [I/O] :Specifies the distance, in pixels, between the left edge of the PrintPreview dialog and the left edge the screen.

PrintPreviewState : Int32 [I/O] : Specifies the state of the PrintPreview dialog window. 0 is normal, 1 is minimized, 2 is maximised.

PrintPreviewTop : Int32 [I/O] : Specifies the distance, in pixels, between the top edge of the PrintPreview dialog and the top edge the screen.

PrintPreviewWidth : Int32 [I/O] : Specifies the width of the PrintPreview dialog.

RightIndent : Int32 [I/O] :  : Int32 [I/O] : Specifies the distance in pixels between the right edge of the control and the left edge of subsequent text.

RightMargin: Int32 [I/O] : Specifies the left margin of the document. May also be read back after displaying the PrintSetup dialog to store the users' choice.

Rtf : String [I/O] : Sets or gets the contents of the control including the RTF formatting information

Strikeout : Boolean [I/O] : If True specifies that the subsequent text is struck out.

Text : String [I/O] : Sets or gets the textual contents of the control without any formatting information

Top : Int32 [I/O] : Specifies the distance, in pixels, between the top edge of the control and the top edge of its' parent form.

TopMargin: Int32 [I/O] : Specifies the top margin of the document. May also be read back after displaying the PrintSetup dialog to store the users' choice.

Underline : Boolean [I/O] : If True specifies that the subsequent text is underlined.

Visible : Boolean [I/O] : If True specifies that the control is visible.

Width : Int32 [I/O] : Specifies the width of the control.