Jump to content

[VB] Word processor creation question


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

 

Archived

This topic is now archived and is closed to further replies.

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