Jump to content

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/74004-vb-word-processor-creation-question/
Share on other sites

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...

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.