Illusion Posted June 9, 2007 Posted June 9, 2007 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 Quote
Leaders dynamic_sysop Posted June 10, 2007 Leaders Posted June 10, 2007 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 Quote
Illusion Posted June 11, 2007 Author Posted June 11, 2007 lol .. so simple.. doh!! thanks!! really appreciated that :) Thanks again! Quote
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.