SendKeys Method

Use the SendKeys method to send a key command to a control. See the Sample Automation for example using the SendKeys method. The SendKeys method has two parameters as shown in the design block below:

Use the keys parameter to send key values or commands:

Key

Code

SHIFT

+

CTRL

^

ALT

%

 

Use the focus parameter to specify whether the control should receive focus when the key or command is sent. This parameter is usually set to True to focus the control.