I tried this sendkey but my PC has frozen. By the way I used XP windows and Microsoft Visual Basic 2005 Express Edition v2.
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
My code is now tested and works fine, maybe it's a problem with another program that fires when this especific key combination is pressed.. it hangs too when you press Alt + Plus with keyboard?
I didn't know how to get useful from this link...I'm newbie.
but I found the prblem is:
when I put this coede in the textbox in down event it gives me many result without stopping the project. but when I execute the code from the button click it generetd one teim, os the problem was in the textbox. How can I set this code to textbox form anohter plce like button click?
I didn't know how to get useful from this link...I'm newbie.
but I found the prblem is:
when I put this coede in the textbox in down event it gives me many result without stopping the project. but when I execute the code from the button click it generetd one teim, os the problem was in the textbox. How can I set this code to textbox form anohter plce like button click?
Sendkeys simply sends keystrokes to the active application, to the best of my knowledge they can not be targeted and work just like the user actually typed from the keyboard. Text always goes where the cursor is.
In your code you placed the code in the keydown event and since the system sees this as a keyboard entry it will execute the keydown event until the program crashes or is halted.
It the textbox is in your program why not just simply set the text property of the text box? Although ALT + Shift + + does not result in a character. Not sure why you need to send this to a textbox within your program In fact I can't think of any reason at all to do so.
Sendkeys simply sends keystrokes to the active application, to the best of my knowledge they can not be targeted and work just like the user actually typed from the keyboard. Text always goes where the cursor is.
True, and is exactly why it's such a bad idea.
However, there is a module that does target a particular window, without interfering with the user's keyboard focus.
However, I think there is another solution to nader's problem, if I could only fully understand it first. lol
EDIT:
You can make the text go right to left, by setting the textbox's property for that.
Code:
TextBox1.TextAlign = HorizontalAlignment.Right
Please elaborate.
Last edited by TT(n); October 23rd, 2008 at 02:26 PM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.