Unicode Controls & Classes for VB6 - Version 4

ctlUniRichTextBoxXP Control

Unicode Rich Textbox, compatible with RichEdit version 1.0, 2.0, 3.0 and 4.1
Check common properties here

Enums
Name Description
eCtlRichTextBox_EditStyle Edit style
eCtlRichTextBox_FindOptions Find Options
eCtlRichTextBox_GetContents GetContents constants
eCtlRichTextBox_HScroll Horizontal scroll constants
eCtlRichTextBox_LanguageOptions Language options
eCtlRichTextBox_LinkEventTypeConstants Type of action related to an event
eCtlRichTextBox_ParagraphAlignmentConstants Paragraph alignment constants
eCtlRichTextBox_ParagraphLineSpacingConstants Paragraph Line Spacing Constants
eCtlRichTextBox_ParagraphNumberingConstants Paragraph Numbering Constants
eCtlRichTextBox_SelectionTypeConstants Selection Type Constants
eCtlRichTextBox_SetContents SetContents constants
eCtlRichTextBox_SetFormatRange Type of selection when formatting
eCtlRichTextBox_TextLength Contains information about how the text length of a rich edit control should be calculated
eCtlRichTextBox_TextModeCodePage Type of codepage
eCtlRichTextBox_TextModeText Type of Textmode
eCtlRichTextBox_TextModeUndoLevel Type of undo management
eCtlRichTextBox_TypographyOptions Typography Options
eCtlRichTextBox_UnderlineType Type of underline
eCtlRichTextBox_UndoTypeConstants Undo Type Constants
eCtlRichTextBox_Version Richedit version constants
eCtlRichTextBox_ViewModes View modes
eCtlRichTextBox_VScroll Vertical scroll constants
eCtlRichTextBox_ZoomFactor Zoom factors
Events
Name Description
SelChange This event is raised everytime the caret changes its position
LinkOver This event occurs when the mouse or the caret is over a link (a portion of text marked with the Link attribute (see [SelLink]))
ModifyProtected This event is raised evetytime a user tries to modify a part of text marked as protected, with the [SelProtected] property.
You can avoid the change by returning bDoIt=False
VScroll
HScroll
Change
Click
DblClick
KeyDown
KeyPress
KeyUp
MouseDown
MouseMove
MouseUp
MouseWheel Raised when the mouse wheel scrolls
IMEComposition Raised when the user confirms a string in the IME editor, check here for details
RequestResize Raised when the content of the control is bigger or smaller that the control size.
This event works only if you enable it using the [RequestResizeEvent] property (by Default is False)
AlignRTL
AlignLTR
Update Sent when an edit control is about to redraw itself. This notification message is sent after the control has formatted the text,
but before it displays the text. This makes it possible to resize the edit control window, if necessary.
Raised if the property [RaiseUpdateEvent] is enabled (by Default is False).
Paste Raised when some text is being pasted to the control.
You can avoid this operation by returning False to the bCancel parameter.
Copy Raised when someone copies some text
Cut Raised when someone cut some text
MsgFilter Permits you to completely manage every RichEdit message changing it if you want.
You need to enable the [RaiseMsgFilterEvent] flag in order to receive this event.
OLEStartDrag
OLESetData
OLEGiveFeedback
OLEDragOver
OLEDragDrop
OLECompleteDrag
Properties
Name Type Description
Alignment (eUniTextbox_Alignment) Gets or sets the alignment for the entire text
AutoURLDetect (Boolean) If automatic URL detection is enabled, the rich edit control scans any modified text to determine whether the text matches the format of a URL. The control detects URLs that begin with the following prefixes:
http: file: mailto: ftp: https: gopher: nntp: prospero: telnet: news: wais:
The control highlights the URL string by underlining it and setting the text color.
BackColor (OLE_COLOR) Gets or sets the Background color of the control
BackColorOut (OLE_COLOR) Gets or sets the Color of the area out of the border (when using Rounded Borders in a non WindowLess control)
Leave -1& for automatic management
BlockAutoCopy (Boolean) The Windows rich text box automatically intercepts some predefined hotkeys so it is able for example to Paste a text if you press the CTRL+V key.
Enable these properties if you need to write customized Copy/Cut/Paste/Undo functions.
BlockAutoCut (Boolean) The Windows rich text box automatically intercepts some predefined hotkeys so it is able for example to Paste a text if you press the CTRL+V key.
Enable these properties if you need to write customized Copy/Cut/Paste/Undo functions.
BlockAutoPaste (Boolean) The Windows rich text box automatically intercepts some predefined hotkeys so it is able for example to Paste a text if you press the CTRL+V key.
Enable these properties if you need to write customized Copy/Cut/Paste/Undo functions.
BlockAutoUndo (Boolean) The Windows rich text box automatically intercepts some predefined hotkeys so it is able for example to Paste a text if you press the CTRL+V key.
Enable these properties if you need to write customized Copy/Cut/Paste/Undo functions.
BorderColor (OLE_COLOR) Gets or sets the Border color
CanCopy (Boolean) Checks if the control can do some actions like Paste, Copy, Undo and Redo
CanPaste (Boolean) Checks if the control can do some actions like Paste, Copy, Undo and Redo
CanRedo (Boolean) Checks if the control can do some actions like Paste, Copy, Undo and Redo
CanUndo (Boolean) Checks if the control can do some actions like Paste, Copy, Undo and Redo
CurrentLine (Long) Gets or sets the current line
Enabled (Boolean) Enables or disables the control
FileName (String) Returns or sets the filename of the file loaded into the RichTextBox control (available only at design time)
Font (Font) Gets or sets the font used for text in the control, check the [ApplyFontChanges] for details
HideSelection (Boolean) Gets or sets the ability to maintain the text selection visible also when the control has no focus (set HideSelection = False)
LanguageOptions (eCtlRichTextBox_LanguageOptions) Gets or sets the language options for the control
LeftMargin (Long) Gets or sets the left margin between text and the control border (in pixels)
Locked (Boolean) Returns or sets a value indicating whether the content of the control can be modified
ManualStart (Boolean) Permits you to activate the control Manually when you incorporate this control into a your custom usercontrol
In order to start the control check the [ExternalInitControl] function
maxLength (Long) Gets or sets the maximum number of chars that the control can contain
Modified (Boolean) Gets or sets the modified flag for the text of the control, a user can reset it, then the flag is changed by the control
MouseIcon (Picture) Gets or sets the MouseIcon for the control
MousePointer (VBRUN.MousePointerConstants) Gets or sets the MousePointer for the control
MultiLine (Boolean) Gets or sets the multiline editing for the control
NoIME (Boolean) Gets or sets the ability to use IME support for the control
OLEDragMode (eCtlOLEDragMode) Gets or sets the OleDragMode for the control
OLEDropMode (eCtlOLEDropMode) Gets or sets the OleDropMode for the control
OnlyBottomBorder (Boolean) Gets or sets the ability to use only a bottom line for the border
OnlyNumbers (Boolean) Gets or sets the ability to support only numbers in the text
PasswordChar (String) Gets or sets the password char (the char used to display charachers when the control is used for inserting a password)
RaiseChangeEvent (Boolean) Gets or sets the ability for the control to raise che Change event when the Text changes, True for default
RaiseMsgFilterEvent (Boolean) Permits you to enable/disable the [MsgFilter] event
RaiseRequestResizeEvent (Boolean) Gets or sets the ability for the control to raise the [RequestResize] event
RaiseSelChangeEvent (Boolean) Gets or sets the ability for the control to raise the [SelChange] event
RaiseUpdateEvent (Boolean) Gets or sets the ability for the control to raise the [Update] event
RedoType (eCtlRichTextBox_UndoTypeConstants) Gets the current redo type
RightMargin (Long) Gets or sets the right margin between text and the control border (in pixels)
RightToLeft (Boolean) Gets or sets the bidirectional input on the entire control
RoundedBorders (Boolean) Gets or sets Rounded borders
ScrollBars (eUniTextbox_ScrollBars) Gets or sets the type of scrollbars used in the control
SelAlignment (eCtlRichTextBox_ParagraphAlignmentConstants) Gets or sets the alignment of the selected paragraph
SelAnimation (Byte) Gets or sets the animation flag for the current selection
SelBackColor (OLE_COLOR) Gets or sets the background color value for the current selection
SelBold (Boolean) Gets or sets the bold style for the current selection
SelBullet (eCtlRichTextBox_ParagraphNumberingConstants) Gets or sets the bullet type for the selected paragraph
SelCharOffset (Long) Gets or sets the character offset for the current paragraph
SelColor (OLE_COLOR) Gets or sets the color value for the current selection
SelfIME (Boolean) Gets or sets the ability for the control to use a self managed IME window
SelFontName (String) Gets or sets the font face for the current selection
SelFontSize (Long) Gets or sets the font size in points for the current selection
SelHangingIndent (Long) Gets or sets the Hanging Indent for the current paragraph
SelIndent (Long) Gets or sets the Indent value for the current paragraph
SelItalic (Boolean) Gets or sets the italic style for the current selection
SelLength (Long) Gets or sets the length of the selected text
SelLink (Boolean) Gets or sets the link value for the current selection; when the mouse goes over this text the [LinkOver] is raised
SelParaRTL (Boolean) Gets or sets the RTL support for the selected paragraph
SelProtected (Boolean) Gets or sets the protection flag for the current selection; when a user tries to modify a protected flag the [ModifyProtected] event is raised
SelRevAuthor (Byte) Gets or sets the Author revision flag for the current selection
SelRightIndent (Long) Gets or sets the right indentation for the selected paragraph
SelRTF (String) Returns or sets the text (in rtf format) in the current selection of a RichTextBox control. Not available at design time
SelSpacing (Integer) Gets or sets the spacing value for the current selection
SelStart (Long) Returns or sets the starting point of the selected text; indicates the insertion point if no text is selected (RUNTIME)
SelStrikeThru (Boolean) Gets or sets the strikeout style for the current selection
SelStyle (Integer) Gets or sets the style flag for the current selection
SelText (String) Gets or sets the selected text
SelUnderline (Boolean) Gets or sets the underline style for the current selection
SelUnderlineType (eCtlRichTextBox_UnderlineType) Gets or sets the type of underline sign for the current selection
SubClassPaintMessage (Boolean) Gets or sets the ability for the control to subclass its paint message
TabSize (Long) Gets or sets the tabulator size
Text (String) Gets or sets the content of the control
TextModeCodePage (eCtlRichTextBox_TextModeCodePage) Gets or sets the current codepage used by the control
TextModeText (eCtlRichTextBox_TextModeText) Gets or sets the current text mode
TextModeUndoLevel (eCtlRichTextBox_TextModeUndoLevel) Gets or sets the curent undo level used by the control
TextRTF (String) Gets or sets the text of a RichTextBox control, including all rtf code
Tip (String) Gets or sets the Unicode Tooltip for the control
TrapTabKey (Boolean) Gets or sets the ability for the control to catch Tab keys
TypographyOptions (eCtlRichTextBox_TypographyOptions) Gets or sets the Typography Options for the control
UndoType (eCtlRichTextBox_UndoTypeConstants) Gets the current undo type
UseRoundRegions (Boolean) Gets or sets the ability to use Round Regions for round borders instead of using the [BackColorOut] property;
VerticalLayout (Boolean) Gets or sets the vertical layout for asian languages
ViewMode (eCtlRichTextBox_ViewModes) Gets or sets the viewmode of the control
ZoomFactor (eCtlRichTextBox_ZoomFactor) Gets or sets the Zoom factor using a simpler method
SetTabStops Please use the [SetTabStopsPx], this property will be removed in the next version
Methods
Name Type Description
ApplyFontChanges When setting a new font on the control you need to call this function in order to refresh the interface
AreNotificationsEnabled (Boolean) Checks if notifications are enabled
BeginUpdate Permits you to start a long-time update on the control without sending out many and many events. So it is faster!
Use un conjunction with [EndUpdate]
Copy Copies the selected text into the clipboard
Cut Cuts the selected text
Delete Deletes the selected text
DisableNotifications Disables control notifications like [Change], [Update], [RequestResize], [SelChange], Mouse and Keyboard events
EmptyUndo Clears the undo stack
EnableNotifications Enables control notifications [Change], [Update], [RequestResize], [SelChange], Mouse and Keyboard events
EndUpdate Terminates a [BeginUpdate] reactivating the control after a long-time update
ExternalInitControl Some controls contained into this package may have bad iterations when used into Usercontrols.
This because VB6 cannot detect, in some cases, that the usercontrol is in Design or User mode so the control may appear running at design time (so you cannot move it in many cases).

Controls that may have problems are: ctlUniTextBoxXP, ctlUniRichTextBoxXP, ctlUniListBoxXP, ctlUniListBoxExXP, ctlUniComboBoxXP

Check this function for a solution sample
Find (Long) Searches the text content for a certain string. Returns the index of the found string, -1 if the string cannot be found.
The iOptions parameter can be a combination of the [eCtlRichTextBox_FindOptions] enum values
FindReplaceAll (Boolean) Find and Replaces all occurences of a string into the text of the control
FindSelect (Long) Searches the text content for a certain string and selects it. Returns the index of the found string, -1 if the string cannot be found.
The iOptions parameter can be a combination of the [eCtlRichTextBox_FindOptions] enum values
GetCharFromPos (Long) Returns the character pointed by given (mouse) coordinates
GetContents (String) Gets the content of the control
GetContentsUTF7 Gets contents using the UTF7 encoding
GetContentsUTF8 Gets contents using the UTF8 encoding
GetCurrentSelType (eCtlRichTextBox_SelectionTypeConstants) Gets the current selection type
GetFirstVisibleLine (Long) Returns the index of the first visible line in the viewport
GetFormatRange Permits you to get multiple formatting properties at a time
GetLastVisibleLine (Long) Gets the index of the last visible line in the viewport
GetLineFirstCharIndex (Long) Gets the index of the first char of a certain line
GetLineFromCharIndex (Long) Returns the line number from the passed character index
GetLineLength (Long) Returns the number of chars in a certain line
GetLinesCount (Long) Gets the number of lines in the text
GetParagraphLineSpacing Gets paragraph line spacing
GetParagraphOffsets Returns paragraph offsets (see also [SelRightIndent], [SelIndent], [SelHangingIndent])
GetParagraphSpacing Gets paragraph spacing
GetPosFromChar Returns the (X,Y) position from the specified char index
GetScrollPos Gets the current scrolling position
GetSelection Gets the selection indexes; same as using [SelStart] and [SelLength]
GetTextMode (Long) Returns a combination of TextMode, UndoLevel and CodePage
Check here for details
GetZoom (Boolean) Gets the current zoom factor, works starting from RichEdit 3.0
HScroll Scrolls horizontally
hWnd (Long) Retuns the handle associated with the control
hWndUserControl (Long) Gets the usercontrol handle (that is different than the RichEdit handle)
IsInIME (Boolean) You can use this property for knowing if the KeyPress, KeyDown and KeyUp events have been raised by the active IME window associated to your control.
IsStarted (Boolean) Returns True if the control is in UserMode
LoadFile (Boolean) Loads an rtf file or text file into a RichTextBox control (also Unicode or UTF8)
MouseIsOverSelection (Boolean) Verifies if the mouse is hovering a selected area of text into the control
OLEDrag Starts an OLEDrag operation
Paste Pastes text from the clipboard
PasteSpecial Pastes text/images from the clipboard
Redo Executes a redo operation
RichEditVersion (eCtlRichTextBox_Version) Returns the richedit version used by the system
SaveFile (Boolean) Saves the content of the control to a file; Returns True if the operation finished correctly
ScrollCaret Scrolls the caret into view in an edit control
SelectAll Selected all text
SelectNone Unselected all text
SetContents Sets the content of the control
SetEditStyle Sets the control edit style
SetFocus Sets the focus to the internal text control
SetFormatRange Permits you to set multiple formatting properties at a time
SetParagraphLineSpacing Sets the paragraph line spacing
SetParagraphOffsets Sets paragraph offsets (see also [SelRightIndent], [SelIndent], [SelHangingIndent])
SetParagraphSpacing Sets paragraph spacing
SetScrollPos Sets the current scrolling position
SetSelection Sets the current selection by specifying indexes
SetTabStopsPx Permits you to set tabulator locations on the richtext
SetTextMode Sets the control TextMode
SetZoom (Boolean) Sets the current Zoom, works starting from RichEdit 3.0
check the [ZoomFactor] property for a simpler way
StopGroupTyping Stops a rich edit control from collecting additional typing actions into the current undo action. The control stores the next typing action, if any, into a new action in the undo queue.
TextLength (Long) Returns the length of the internal text
Undo Executes an undo operation
VScroll Scrolls vertically
z__LoadCallBack (Long) Reserved, don't use
z__SaveCallBack (Long) Reserved, don't use
Remarks

(ctlUniRichTextBoxXP control with Paragraph alignment, background color, bullets and Unicode Text)


(the ctlUniRichTextBoxXP control supports Unicode text at Design time)