I have a RTB that loads data from a file like this in the Load event of the Form2
After i load this file i want to replace some key words with a specified text but here i'm stuck...Code:Me.rtb_cerere.LoadFile(Application.StartupPath & "\ceelceur.rtf")
I use this...
How can i replace this {1} with "TEST" ? I have spend 2 days and i'm lost in the space!Code:Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim PozitieCurenta As Integer = Me.rtb_cerere.SelectionStart Dim SelectieCurenta As Integer = Me.rtb_cerere.SelectionLength Dim CuvantCheie As String = "{1}" Me.rtb_cerere.Select(StartPosition - 1, CuvantCheie.Length) Me.rtb_cerere.ScrollToCaret() Me.Focus() Me.rtb_cerere.Rtf = Replace(Me.rtb_cerere.Rtf, Trim(CuvantCheie), Trim("TEST")) Me.rtb_cerere.SelectionStart = PozitieCurenta Me.rtb_cerere.SelectionLength = SelectieCurenta Me.Focus() End Sub
Thanks...




Reply With Quote