Question How to send CTRL-V to a .NET control

Hi everybody,

OE12.6, Win10

I want to send CTRL-V to a RichTextBox, using this code:

Code:
DEF VAR m AS System.Windows.Forms.Message     NO-UNDO.

m = NEW System.Windows.Forms.Message().
RichTextBox:ProcessCmdKey(m, CAST(Progress.Util.EnumHelper:Or(System.Windows.Forms.Keys:Control, System.Windows.Forms.Keys:V), System.Windows.Forms.Keys)).

but this results in "Could not locate method '<method-name>' with matching signature in class '<class-name>'. " during compilation.

Could anybody please point me in the right direction ?
Tia, Wolf
 
I am not sure if this is the solution but does something like this work?:

Code:
System.Windows.Forms.SendKeys:Send(CAST(Progress.Util.EnumHelper:Or(System.Windows.Forms.Keys:Control,
                                                                    System.Windows.Forms.Keys:V)).
 
I am not sure if this is the solution but does something like this work?:

Code:
System.Windows.Forms.SendKeys:Send(CAST(Progress.Util.EnumHelper:Or(System.Windows.Forms.Keys:Control,
                                                                    System.Windows.Forms.Keys:V)).
Unfortunately not. it gives compile-error "Parameter 1 for METHOD is not type compatible with its definition. (12905)"
 
Ah right, that does not work. You can do something like this with SendKeys but unfortunately do not know the correct text for CTRL-V:
Code:
System.Windows.Forms.SendKeys:Send("e").
System.Windows.Forms.SendKeys:Send("~{END}").
 
based on SendKeys Class (System.Windows.Forms) it seems to be:

Code:
System.Windows.Forms.SendKeys:Send('^v')

As to the initial could not locate method error - if you use the PDSOE class browser (CTRL+F12) and go to class System.Windows.Forms.RichTextBox and then select method ProcessCmdKey - it shows a yellow diamond on the method, indicating that the method is protected.
 
Back
Top