Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I wondered if someone could help/point me in the right direction :)

 

I add some text to a richtextbox and call the undo method and nothing happens.. however if i type into the box and call the undo method it works..

what am I missing here :| ..

 

I add the text by :

 

richtextbox1.text = "blah"

richtextbox1.text = richtextbox1.text + " and more blah"

 

so I then click on the undo button and nothing happens.. im guessing its not registering to be undone.. but how do I go about getting it to be accepted?

I did try cutting and pasting, but thats just a dirty fix.. any clean ones?

 

Thanks

  • Leaders
Posted

you should be using AppendText not " richtextbox.text = "

if you use the following you should see it work...

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       RichTextBox1.AppendText("blabla ")
       RichTextBox1.AppendText("something else")
   End Sub
   Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
       RichTextBox1.Undo()
   End Sub

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.   Paste as plain text instead

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