Mathematicman Posted October 19, 2007 Share Posted October 19, 2007 Hey everybody I have a question about Visual Basic computer code. I’m making a program for a computer science course I’m doing. Basically I’m making a simple word processor like notepad. I want to make it better than I need to though, so I’m going to make an add-on, where when you click a button it pastes some text, maybe html or php, in the text box. My problem is I can’t figure out how to program the code to do it. Basically I want the code to be pasted where the type cursor/caret is. But I don’t know how to go about this. Can you help me? Thanks Joshua Quote Link to comment https://forums.phpfreaks.com/topic/74004-vb-word-processor-creation-question/ Share on other sites More sharing options...
derwert Posted October 21, 2007 Share Posted October 21, 2007 In VB you have access to the Clipboard, they put it as an object. It may vary depending on which version of VB you're using (e.g. VB6, VB.NET, VB7) so you'd be better off consulting MSDN for your version. Quote Link to comment https://forums.phpfreaks.com/topic/74004-vb-word-processor-creation-question/#findComment-374669 Share on other sites More sharing options...
Mathematicman Posted October 21, 2007 Author Share Posted October 21, 2007 Here's a function that I made to do it... but it's not completely what I was wanting... for one thing if there is any text selected it deletes it, and if your using Microsoft word, it has the history of copied objects... but I want it to insert it where the text cursor is... so if anybody could help that would be good... Function inputText(ByVal text As String) RichTextBox2.Paste() RichTextBox3.Text = text RichTextBox3.SelectAll() RichTextBox3.Copy() mainBox.Paste() RichTextBox2.SelectAll() RichTextBox2.Copy() End Function And btw, I have Visual Basic .Net... Oh, and variable "text" is the text I want to insert... Quote Link to comment https://forums.phpfreaks.com/topic/74004-vb-word-processor-creation-question/#findComment-375096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.