Hi,
Please help me a little bit as I'm stuck.
I have two textboxes. I type in one of them and the text gets copied in real time into another textbox. There is one catch. I need to replace specific character with something else.
If I enter a quote " in textbox1, it has to be replaced with \" in textbox2.
I started with something like the below code, but obviously this does not work (tried different stuff - this is for demonstration only). In the example below 'a' represents " , and 'b' represents \"
In other words... whenever I enter the quote character into the textbox1 I want it to be replaced in textbox2 with a backslash+quote.Code:Private Sub TextBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.KeyUp TextBox2.Text = TextBox1.Text If TextBox2.Text.Contains("a") Then TextBox2.Text.Replace("a", "b") End If End Sub
Example of my goal:
text in textbox1: Where "Glogow" is?
text in textbox2: Where \"Glogow\" is?
Can this be done ?




Reply With Quote
