RE: Generating or simulating key events sent to control on form
- From: v-garych@xxxxxxxxxxxxxxxxxxxx ("Gary Chang[MSFT]")
- Date: Fri, 17 Feb 2006 06:34:09 GMT
Hi Ivan,
Is there a way of generating a keyboard character event
and sending it to a control on a form?
Have you tried the System.Windows.Forms.SendKeys class?
I suggest you can set the focus to the target control first, then call the
System.Windows.Forms.SendKeys.Send method to send the keystroke, such as:
Control1.Focus()
System.Windows.Forms.SendKeys.Send("{DEL}")
Please refer to the following MSDN documentation for the details:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformssendkeysclasstopic.asp
Thanks!
Best regards,
Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
.
- Follow-Ups:
- References:
- Prev by Date: Re: Business Objects
- Next by Date: Re: sprintf localized?
- Previous by thread: Re: Generating or simulating key events sent to control on form
- Next by thread: Re: Generating or simulating key events sent to control on form
- Index(es):
Relevant Pages
|