|
-
Jul 8th, 2008, 12:06 PM
#1
Thread Starter
Lively Member
[RESOLVED] How to track changes on a richtextbox
Hello Evryone
I have an Edit form that has two Richtextboxes:
*
I would like to keep track of who makes the changes or edits the form, and I have the following code: and is working just fine:
Dim stamp As String = "Edited by " & LoginForm1.UsernameTextBox.Text & " on " & Date.Now.ToString
Me.RichTextBox1.AppendText(Environment.NewLine & stamp)
Me.RichTextBox2.AppendText(Environment.NewLine & stamp)
*
The problem that I am having is that I would like to only add the tracking*log to the RichTextBox that I am modifying.
Right now if I edit RichTextBox1, it will add the tacking log, but is also adding the tracking log to the RichTextBox2, and I have not touched RichTextBox2,
How can I make it to work to only add the tacking log to the one that I am touching?
*
Thanks for your help
-
Jul 8th, 2008, 12:41 PM
#2
Addicted Member
Re: How to track changes on a richtextbox
How are you tracking the changes anyway? Using one of these?:
Code:
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
End Sub
If you are using these events separately for each box, it should work appropriately.
-
Jul 8th, 2008, 12:47 PM
#3
Thread Starter
Lively Member
Re: How to track changes on a richtextbox
Thanks Sauronsmatrix for your quick responce.
I have the following code under the save event, is it wrong?
Code:
Dim stamp As String = "Edited by " & LoginForm1.UsernameTextBox.Text & " on " & Date.Now.ToString
Me.RichTextBox1.AppendText(Environment.NewLine & stamp)
Me.RichTextBox2.AppendText(Environment.NewLine & stamp
Thanks
-
Jul 8th, 2008, 12:56 PM
#4
Addicted Member
Re: How to track changes on a richtextbox
im stamp As String = "Edited by " & LoginForm1.UsernameTextBox.Text & " on " & Date.Now.ToString
Me.RichTextBox1.AppendText(Environment.NewLine & stamp)
Me.RichTextBox2.AppendText(Environment.NewLine & stamp
Well you told it to stamp it regardless, so thats that. Maybe you want to have booleans for if the user edited the fields using the .TextChanged event, then have something like:
Code:
If blnChanged Then Me.RichTextBox2.AppendText(Environment.NewLine & stamp)
-
Jul 8th, 2008, 12:59 PM
#5
Thread Starter
Lively Member
Re: How to track changes on a richtextbox
Quick question: Do i need to declare the "blnChanged"?
Thanks,
-
Jul 8th, 2008, 01:39 PM
#6
Addicted Member
Re: [RESOLVED] How to track changes on a richtextbox
Dim blnChanged As Boolean
Booleans can either have a value of True or False.
-
Jul 8th, 2008, 01:48 PM
#7
Thread Starter
Lively Member
Re: [RESOLVED] How to track changes on a richtextbox
Thank you so much for your help.
BK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|