Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SendWait Method
Collapse the table of content
Expand the table of content

SendKeys.SendWait Method

Sends the given keys to the active application, and then waits for the messages to be processed.

[Visual Basic]
Public Shared Sub SendWait( _
   ByVal keys As String _
public static void SendWait(
 string keys
public: static void SendWait(
 String* keys
public static function SendWait(
   keys : String


The string of keystrokes to send.


Use SendWait to send keystrokes or combinations of keystrokes to the active application and wait for the keystroke messages to be processed. You can use this method to send keystrokes to an application and wait for any processes that are started by the keystrokes to be completed. This can be important if the other application must finish before your application can continue.

Note   Because there is no managed method to activate another application, you can either use this class within the current application or use native Windows methods, such as FindWindow and SetForegroundWindow, to force focus on other applications.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

SendKeys Class | SendKeys Members | System.Windows.Forms Namespace

© 2015 Microsoft