RE: Generating or simulating key events sent to control on form

Tech-Archive recommends: Speed Up your PC by fixing your registry



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.
======================================================

.



Relevant Pages

  • Re: WMI Path Problem
    ... please refer to the sample script in the following technet link: ... PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00 ... entering the secure code mmpng06 when prompted. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VS2005: F1 online help does not work within aspx.cs files
    ... corresponding online MSDN documentaion topic with the selected syntax ... PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00 ... entering the secure code mmpng06 when prompted. ...
    (microsoft.public.vsnet.ide)
  • Re: Why is debugging is super slow on 1 particular project?
    ... C:\Program Files\Microsoft Visual Studio .NET ... PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00 ... entering the secure code mmpng06 when prompted. ...
    (microsoft.public.vsnet.debugging)
  • Re: Why is debugging is super slow on 1 particular project?
    ... the delay i experience is 4 seconds to go from 1 line to the other. ... PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00 ... entering the secure code mmpng06 when prompted. ...
    (microsoft.public.vsnet.debugging)
  • Re: Why is debugging is super slow on 1 particular project?
    ... which could be used to access data in an Exchange Server Web Store. ... PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00 ... entering the secure code mmpng06 when prompted. ...
    (microsoft.public.vsnet.debugging)