Creates an Ocx RichEdit control in the current active form, window, or dialog.
Ocx RichEdit name = text$ [, id], x, y, b, h [, style%]
text$:control text
id%:control identifier
x, y, b, h:iexp
style%:the control styles
The RichEdit control allows the user to enter and edit text while also providing more advanced formatting features than the conventional TextBox control.
The RichEdit control provides a number of properties you can use to apply formatting to any portion of text within the control. To change the formatting of text, it must first be selected. Only selected text can be assigned character and paragraph formatting. Using these properties, you can make text bold or italic, change the color, and create superscripts and subscripts. You can also adjust paragraph formatting by setting both left and right indents, as well as hanging indents.
The RichEdit control opens and saves files in both the RTF format and regular ASCII text format. You can use methods of the control (LoadFile and SaveFile) to directly read and write files, or use properties of the control such as SelRTF and TextRTF in conjunction with GFA-BASIC 32's file input/output statements.
To print all or part of the text in a RichEdit control use the SelPrint method.
The RichEdit control supports almost all of the properties, events, and methods used with the standard TextBox control, such as MaxLength, MultiLine, ScrollBars, SelLength, SelStart, and SelText. Applications that already use TextBox controls can easily be adapted to make use of RichEdit controls.
Note: With TextBox - in this instance, given the name tb - it is possible to get the text by using the shortcut text$ = tb; similarly, it is possible to manipulate and/or check the text using the functions Len(), Left(), Right(), etc. This does not work with a RichEdit control as the value returned contains all the RTF formatting as well and may cause an error. To use the actual unformatted text, the Text and TextLength properties should be used instead.
Appearance | BackColor | BorderStyle | BulletIndent | CharFormat | DefCharFormat | DisableNoScroll | Enabled | Font | FontBold | FontItalic | FontStrikethru | FontUnderline | FontName | FontSize | ForeColor | FormatDC | FormatWidth | Height | HelpContextID | HideSelection | hWnd | Index | Left | Locked | MaxLength | MouseCursor | MouseIcon | MousePointer | MultiLine | Name | ParaFormat | Parent | ReadOnly | ScrollBars | SelAlignment | SelBold | SelBullet | SelCharOffset | SelColor | SelFontName | SelFontSize | SelHangingIndent | SelIndent | SelItalic | SelLength | SelProtected | SelRightIndent | SelRTF | SelStart | SelStrikeout | SelTabCount | SelTabs | SelText | SelLine | SelUnderLine | TabStop | Tag | Text | TextLength | TextRTF | Top | ToolTiptext | Visible | WantSpecial | WhatsThisHelpID | Width
DoClick | CharFromLine | ColFromChar | Find | GetLineFromChar | LineCount | LineFromChar | LoadFile | Move | Refresh | RowFromChar | SaveFile | SelPrint | SelPrintRect | SetFont | Scroll | ScrollCaret | Span | TextHeight | TextWidth | UpTo | ZOrder
Change | Click | DblClick | GotFocus | LostFocus | KeyDown, Keyup | KeyPress | MouseDown | MouseUp | MouseMove | Protected | SelChange
Ocx RichEdit rtf = "", 10, 10, 300, 200 : .BorderStyle = 3
rtf.SelText = String( 5, "GFA-BASIC 32 ")
rtf.SelItalic = 1
rtf.SelText = String( 5, "GFA-BASIC 32 ")
rtf.SelBold = 1
rtf.SelText = String( 5, "GFA-BASIC 32 ")
rtf.SelItalic = 0
rtf.SelText = String( 5, "GFA-BASIC 32 ")
Ocx RichEdit rtf_copy = "", 320, 10, 300, 200 : .BorderStyle = 3
Do : Sleep : Until Me Is Nothing
The RichEdit control comes with in-built shortcut keys which are listed on the Microsoft website and a list of which are copied below. It should be noted that not all keyboard configurations will support all shortcuts, as it should also be noted that, on some keyboards, the shortcut keys may be different due to different key layout (for example, on some keyboards, Ctrl+# is used for acute accents and Ctrl+' for grave, rather than Ctrl-' and Ctrl-` as noted below).
Keys | Operations | Comments |
---|---|---|
Shift+Backspace | Generate a LRM/LRM on a bidi keyboard | BiDi specific |
Ctrl+Tab | Tab | |
Ctrl+Clear | Select all | |
Ctrl+Number Pad 5 | Select all | |
Ctrl+A | Select all | |
Ctrl+E | Center alignment | |
Ctrl+J | Justify alignment | |
Ctrl+R | Right alignment | |
Ctrl+L | Left alignment | |
Ctrl+C | Copy | |
Ctrl+V | Paste | |
Ctrl+X | Cut | |
Ctrl+Z | Undo | |
Ctrl+Y | Redo | |
Ctrl+'+' (Ctrl+Shift+'=') | Superscript | |
Ctrl+'=' | Subscript | |
Ctrl+1 | Line spacing = 1 line. | |
Ctrl+2 | Line spacing = 2 lines. | |
Ctrl+5 | Line spacing = 1.5 lines. | |
Ctrl+' (apostrophe) | Accent acute | After pressing the short cut key, press the appropriate letter (for example a, e, or u). This applies to English, French, German, Italian, and Spanish keyboards only. |
Ctrl+` (grave) | Accent grave | See Ctrl+' comments. |
Ctrl+~ (tilde) | Accent tilde | See Ctrl+' comments. |
Ctrl+; (semicolon) | Accent umlaut | See Ctrl+' comments. |
Ctrl+Shift+6 | Accent caret (circumflex) | See Ctrl+' comments. |
Ctrl+, (comma) | Accent cedilla | See Ctrl+' comments. |
Ctrl+Shift+' (apostrophe) | Activate smart quotes | |
Backspace | If text is protected, beep and do not delete it. Otherwise, delete previous character. | |
Ctrl+Backspace | Delete previous word. This generates a VK_F16 code. | |
F16 | Same as Backspace. | |
Ctrl+Insert | Copy | |
Shift+Insert | Paste | |
Insert | Overwrite | DBCS does not overwrite. |
Ctrl+Left Arrow | Move cursor one word to the left. | On bidi keyboard, this depends on the direction of the text. |
Ctrl+Right Arrow | Move cursor one word to the right. | See Ctrl+Left Arrow comments. |
Ctrl+Left Shift | Left alignment | In BiDi documents, this is for left-to-right reading order. |
Ctrl+Right Shift | Right alignment | In BiDi documents, this is for right-to-left reading order. |
Ctrl+Up Arrow | Move to the line above. | |
Ctrl+Down Arrow | Move to the line below. | |
Ctrl+Home | Move to the beginning of the document. | |
Ctrl+End | Move to the end of the document. | |
Ctrl+Page Up | Move one page up. | If in SystemEditMode and Single Line control, do nothing. |
Ctrl+Page Down | Move one page down. | See Ctrl+Page Up comments. |
Ctrl+Delete | Delete the next word or selected characters. | |
Shift+Delete | Cut the selected characters. | |
Esc | Stop drag-drop. | While doing a drag-drop of text. |
Alt+Esc | Change the active application. | |
Alt+X | Converts the Unicode hexadecimal value preceding the insertion point to the corresponding Unicode character. | |
Alt+Shift+X | Converts the Unicode character preceding the insertion point to the corresponding Unicode hexadecimal value. | |
Alt+0xxx (Number Pad) | Inserts Unicode values if xxx is greater than 255. When xxx is less than 256, ASCI range text is inserted based on the current keyboard. | Must enter decimal values. |
Alt+Shift+Ctrl+F12 | Hex to Unicode. | In case Alt+X is already taken for another use. |
Alt+Shift+Ctrl+F11 | Selected text will be output to the debugger window and saved to %temp%\DumpFontInfo.txt. | For Debug only (need to set Flag=8 in Win.ini) |
Ctrl+Shift+A | Set all caps. | |
Ctrl+Shift+L | Fiddle bullet style. | |
Ctrl+Shift+Right Arrow | Increase font size. | Font size changes by 1 point in the range 4pt-11pt; by 2points for 12pt-28pt; it changes from 28pt -> 36pt -> 48pt -> 72pt -> 80pt; it changes by 10 points in the range 80pt - 1630pt; the maximum value is 1638. |
Ctrl+Shift+Left Arrow | Decrease font size. | See Ctrl+Shift+Right Arrow comments. |
Animation, CheckBox, ComboBox, Command, CommDlg, Form, Frame, Image, ImageList, Label, ListBox, ListView, MonthView, Option, ProgressBar, Scroll, Slider, StatusBar, TabStrip, TextBox, Timer, TrayIcon, TreeView, UpDown
{Created by Sjouke Hamstra; Last updated: 25/08/2021 by James Gaite}