Name

SendKeys

Synopsis

This utility class offers three methods to dispatch keypresses to the active application.

Send() sends a string of keystrokes. Nonprintable keys are represented by a series of special character codes between curly braces (for example Page Down is {PGDN}).

Flush() pumps messages until the keys have all been sent. SendWait() sends the keystrokes and pumps messages until all the keys have been sent. It is equivalent to Send( ) followed by Flush().


public class SendKeys {

// Public Static Methods

   public static void Flush();

   public static void Send(string keys);

   public static void SendWait(string keys);

}

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.