OnCompleteWord Event

[Top]  [Chapter]  [Previous]  [Next]

Member of WPDLLInt

Declaration C#

OnCompleteWordEvent(Object Sender, int Editor, ref byte LastChar);


Declaration OCX

OnCompleteWord(ByVal Editor As Long, LastChar As Byte)


This event allows it to implement auto completion and makro functionality. If the user types in a word and then presses a word delimiting character, this event is triggered. The delimiting character will be passes as parameter LastChar. You can set it to 0 if you do not want to use it in the text, for example if the character is a control key.


To read or update the last word use SelText. You can also use LoadFromString to insert a block of formatted text at cursor position.


VB Example:

Private Sub WPDLLInt1_OnCompleteWord(ByVal Editor As Long, LastChar As Byte)

  Dim w As String

  w = WPDLLInt1.CurrMemo.SelText

  If w = "mfg" Then

    WPDLLInt1.CurrMemo.SelText = "Mit freundlichen Grüßen"

  ElseIf w = "logo" Then

    WPDLLInt1.TextCursor.InputImage "c:\logo.png", 0

  End If

End Sub

[idh_wpdllint_oncompleteword.htm]    Copyright © 2007 by WPCubed GmbH