How do I copy data from one control to another

bbarclay

Member
Joined
Sep 15, 2006
Messages
23
Programming Experience
Beginner
I need to take from a textbox information from my application and

click an arrow right button -> and have it copy textbox1 information to where ever the cursor is.

Thanks

Brandon

-Here's how it works
VB.NET:
WB.Document.ActiveElement.InnerText = "hello"
(where the WB is replace with the name of your browser. Then where "hello" is replace that with the text box you have. Mine was named textbox1. Be sure that you add an ending like textbox1.text and remove the quotes. Then you place that code in your button.

VB.NET:
Sub ButtonClick1_ click
MyWebBrowsersNameHere.Document.ActiveElement.InnerText = TextBox1.Text
End Sub

Here's a copy of the code if you need it.

http://brandonbarclay.com/FormsExample.zip gets solved so I included a copy of sample code to show how. Must be ran in visual studio 2005
 
Last edited:
What exactly do you mean by "where the cursor is"? Do you mean into the control that has focus or where the mouse pointer is? Do you mean outside of your application or only inside? What if the control that has focus can't receive input? Please elaborate. Assume we don't know anything about what you're doing... because we don't.
 
Ok here's what I mean

On the left side of my form I have a multiline textbox which allows the user to type in any information that they want. Then when they place their cursor on the right side of the form "the web browser built into the application" Then they can place their cursor in the text boxes in the browser and when clicking the arrow it will take the information from the left text box and transfer it to the right "where the cursor is placed."

Example: http://brandonbarclay.com/example.JPG Here

1. Put text in the text box
2. Place curser somewhere in the web browser "within the application
3. Click the copy to curser button
4. Information from the text box copies to the curser where ever it is.


Hope this helps.

Thanks
 
I have no answer for you but I am curious for it. If anyone can help this guy you would be helpig two people. I would think you need to find a way and obtain the controls from within the browser. But I don't know how to do this.
 
Example where 'WB' is the webbrowser control:
VB.NET:
WB.Document.ActiveElement.InnerText = "hello"
 
Back
Top