I currently have a rich textbox control on my Windows Form which allows the user to overwrite text when the Insert Key is pressed.  Is there a way to trigger the insert key control so that the user does not have to manually hit the insert key in order to overwrite text? I looked at the following link:  https://docs.microsoft.com/en-us/dotnet/framework/winforms/how-to-simulate-mouse-and-keyboard-events-in-code
 
The C# code to accomplish this is :
private void Form1_DoubleClick(object sender, EventArgs e)
{
    SendKeys.Send("{INSERT}");
}
 
In Managed COBOL I tried the following when the form loads:
set self::System.Windows.Forms.SendKey("INSERT")
 
I also tried the same code for the control as follows:
set rchTextBox1::KeyUp to type System.Windows.Forms.SendKey("INSERT")
 
Neither code compiles as they give me errors.
I believe you would have to send the INSERT key every time you enter the RichTextBox. Of course if the user manually presses Insert then it will toggle the behavior.
The following works for me for a form on which there are 2 RichTextBox controls.
       method-id RichTextBox1_Enter final private.
       procedure division using by value sender as object e as type System.EventArgs.
               invoke type SendKeys::Send("{INSERT}")
       end method.
       method-id RichTextBox2_Enter final private.
       procedure division using by value sender as object e as type System.EventArgs.
               invoke type SendKeys::Send("{INSERT}")
       end method.
                
     
                                    
            I created a video awhile back which covers the basics of using the .NET Framework with Visual COBOL including how to convert a simple C# example to OO COBOL.
You can find this video here:
You mentioned that you were getting errors on the syntax that you tried.
I would like to explain why you received errors.
         set self::System.Windows.Forms.SendKey("INSERT")
the predefined object SELF refers to the currently running object which in a Windows Forms application would be the instance of the current form or control itself. You can use the self:: syntax only to access the properties or the methods that actually exist within the current form or control or its parent classes.
System.Windows.Forms.SendKeys is a class which is part of the .NET Framework and its documentation can be found here.  This explains that the SendKeys class contains a static method called Send that is used to simulate a keystroke.
You invoke a method in Visual COBOL using the invoke statement. If you are invoking a static method such as Send then you would need to preface the class name with the type keyword to indicate that the name is a class and not an object. In OO COBOL the double-colon operator :: is used to separate a class or object from its method and property names. in C# the period is used for this.
Invoking the Send method in the SendKeys class and passing the parameter {INSERT}       
C# example
      SendKeys.Send("{INSERT}");
COBOL example:
 invoke type SendKeys::Send("{INSERT}")
For your second try you used:
set rchTextBox1::KeyUp to type System.Windows.Forms.SendKey("INSERT")
KeyUp is an event which can trigger an event handler method when it is fired. You cannot set an event to a value but you can fire an event using the invoke statement. You can use the set statement to set a property value in an object or class or to set another data item or object to the return value of a property or method.
There are a number of demo programs available in the Samples Browser under the category Language Reference for .NET COBOL that may help you become better acquainted with the syntax used.
                
     
                                    
            I created a video awhile back which covers the basics of using the .NET Framework with Visual COBOL including how to convert a simple C# example to OO COBOL.
You can find this video here:
You mentioned that you were getting errors on the syntax that you tried.
I would like to explain why you received errors.
         set self::System.Windows.Forms.SendKey("INSERT")
the predefined object SELF refers to the currently running object which in a Windows Forms application would be the instance of the current form or control itself. You can use the self:: syntax only to access the properties or the methods that actually exist within the current form or control or its parent classes.
System.Windows.Forms.SendKeys is a class which is part of the .NET Framework and its documentation can be found here.  This explains that the SendKeys class contains a static method called Send that is used to simulate a keystroke.
You invoke a method in Visual COBOL using the invoke statement. If you are invoking a static method such as Send then you would need to preface the class name with the type keyword to indicate that the name is a class and not an object. In OO COBOL the double-colon operator :: is used to separate a class or object from its method and property names. in C# the period is used for this.
Invoking the Send method in the SendKeys class and passing the parameter {INSERT}       
C# example
      SendKeys.Send("{INSERT}");
COBOL example:
 invoke type SendKeys::Send("{INSERT}")
For your second try you used:
set rchTextBox1::KeyUp to type System.Windows.Forms.SendKey("INSERT")
KeyUp is an event which can trigger an event handler method when it is fired. You cannot set an event to a value but you can fire an event using the invoke statement. You can use the set statement to set a property value in an object or class or to set another data item or object to the return value of a property or method.
There are a number of demo programs available in the Samples Browser under the category Language Reference for .NET COBOL that may help you become better acquainted with the syntax used.
Thank you for the resources as it is much appreciated!