Click here to Skip to main content
15,921,694 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello

I need to take a text from textbox1 and putt it in other program text box .
How can I do that and with what?

What I have tried:

so far i saw SendKey but htat is sending the specify text and my text will change
Posted
Updated 4-Apr-17 22:01pm
v2

1 solution

Quote:
SendKey but htat is sending the specify text and my text will change


SendKeys.Send[^] sends whatever string you you pass it: the examples use a fixed string becasue they are just that: examples of how to use it. They are not explicit instructions on how to do exactly what your task requires, they are they to give you the idea how to use the method.
Wherever a method accepts a string in C#, it can accept a fixed string:
C#
SendKeys.Send("Hello");

Or a variable containing a reference to a fixed string:
C#
string aVariableName = "Hello " + myTextBox.Text;
SendKeys.Send(aVariableName);
 
Share this answer
 
Comments
Member 13084733 5-Apr-17 4:52am    
Yes but that will not send text to specify text box of another application or am i wrong?
OriginalGriff 5-Apr-17 5:29am    
No, but you can send the keycodes for getting to the textbox with the text.
^{HOME}{TAB}{TAB}Hello
Will cause it to go to the first user input control, then TAB to the second, the third, and then enter "Hello".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900