| View previous topic :: View next topic |
| Author |
Message |
TheIndianGuy Advanced Cheater
Reputation: 102
Joined: 14 Jan 2007 Posts: 88
|
Posted: Tue Aug 28, 2007 2:54 pm Post subject: slovach, i need more help (everyone feel free to help) |
|
|
i tested my auto typer and what happens is it sends the text from the textbox fine but i also wanted it to hit enter but instead it hits enter and sends the text enter here is my code how should i fix it so it stops sending the text enter and only "hits" the button enter
| Code: | private void timer1_Tick(object sender, EventArgs e)
{
SendKeys.Send(textBox2.Text);
SendKeys.Send("(Enter)");
} |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Tue Aug 28, 2007 3:59 pm Post subject: |
|
|
well in C++ this works
so, it will probs work in C#
instead of using SendKeys.send("(ENTER)")
use \r\n
Example code:
| Code: | | textbox1.text = textbox1.text+"\r\n" |
which is a carriage return then a new line.
also, i think in C++ its ("{ENTER}"), not sure if its diff from C#
i dont know C# but its very similar to C++, just using .'s instead of ->'s or ::'s
_________________
|
|
| Back to top |
|
 |
TheIndianGuy Advanced Cheater
Reputation: 102
Joined: 14 Jan 2007 Posts: 88
|
Posted: Tue Aug 28, 2007 4:02 pm Post subject: |
|
|
| lurc wrote: | well in C++ this works
so, it will probs work in C#
instead of using SendKeys.send("(ENTER)")
use \r\n
Example code:
| Code: | | textbox1.text = textbox1.text+"\r\n" |
which is a carriage return then a new line.
also, i think in C++ its ("{ENTER}"), not sure if its diff from C#
i dont know C# but its very similar to C++, just using .'s instead of ->'s or ::'s |
yeah you were right it is ("{ENTER}") i tried that and it worked, ("(enter)") works fine for me in vb so i just assumed that for V C#
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Tue Aug 28, 2007 5:10 pm Post subject: |
|
|
This doesn't really have anything to do with the problem, as it has been solved, but I suggest that you use
| Code: |
SendKeys.SendWait(...);
|
rather than
| Code: |
SendKeys.Send(...);
|
Why? SendKeys.Send is just going to send your message incredibly quickly, and will most likely not give the program/Windows/whatever a chance to respond. SendKeys.SendWait sends the key stroke, then waits for whatever to comprehend it, then continues on.
|
|
| Back to top |
|
 |
TheIndianGuy Advanced Cheater
Reputation: 102
Joined: 14 Jan 2007 Posts: 88
|
Posted: Tue Aug 28, 2007 6:22 pm Post subject: |
|
|
| the point is the send the message quickly but thanks for the advise
|
|
| Back to top |
|
 |
|