|[Top] [Chapter] [Previous] [Next]|
Member of WPDLLInt
Here the standard event is used.
You need to cast e to wpKeyEventArgs which contains the properties Editor, Shift, Alt and Control:
if ((wpKeyEventArgs)e).Control) ...
OnKeyPress(ByVal Editor As Long, Key As Byte)
This event is triggered when the user types on the keyboard. It receives the key as character value.
You can use this event to implement short cuts, for example activate 'bold' when Ctrl+B is pressed:
Example VB6 (also see OnKeyDown):
Private Sub WPDLLInt1_OnKeyPress(ByVal Editor As Long, Key As Byte)
Dim Memo As IWPMemo
If Editor = 2 Then Set Memo = WPDLLInt1.Memo2 Else: Set Memo = WPDLLInt1.Memo
If Key = 2 Then ' Ctrl B
If Memo.TextCursor.IsSelected Then
Memo.CurrAttr.ToggleStyle (0) ' set bold!
Key = 0