|
-
Oct 11th, 2008, 08:31 PM
#1
Thread Starter
Fanatic Member
Problem with sendkey
I tried this sendkey but my PC has frozen. By the way I used XP windows and Microsoft Visual Basic 2005 Express Edition v2.
vb Code:
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
System.Windows.Forms.SendKeys.Send("%+")
End Sub
Last edited by nader; Oct 11th, 2008 at 08:53 PM.
-
Oct 13th, 2008, 08:12 AM
#2
Re: Problem with sendkey
And why are you using SendKeys in the first place? You haven't told us anything other than you're using it and it's crashing your comp
-
Oct 13th, 2008, 08:28 AM
#3
Re: Problem with sendkey
As I've said in another of your threads, Shift, Alt and Ctrl are supposed to modify the behaviour of other keys, not produce behaviour of their own. While it doesn't say specifically that you cannot use modifier keys on their own with SendKeys.Send, the documentation does say this:
To specify keys combined with any combination of the SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following codes.
which implies it.
-
Oct 13th, 2008, 12:39 PM
#4
Thread Starter
Fanatic Member
Re: Problem with sendkey
Please Take a look to this topic it will expalin what I want to do this.
http://www.vbforums.com/showthread.php?t=542889
-
Oct 13th, 2008, 02:00 PM
#5
Re: Problem with sendkey
The answer has been given to you in those threads, given what you're trying to do, there's no reason to be using SendKeys at all and if you do, it might cause unpredicted results especially if your app looses focus right before it hits the SendKeys line (which would send the keys to the app that does have focus, not yours)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|